This class provides a factory that processes PackedNavBits data containing BeiDou D2 NAV data as defined in the BeiDou ICD. The results of the addData method (in the navOut argument) may contain any number of BDSD2NavAlm, BDSD2NavEph, BDSD2NavHealth or BDSD2NavTimeOffset objects, according to what data is fed to the method and what data is requested via the validity and type filters (see PNBNavDataFactory).
The D2 NAV data structure is set up to provide almanac and health data for PRNs >30 by flagging it in other almanac pages using the AmEpID. My interpretation of the ICD, and data seems to back this up, is that AmEpID is only meaningful when it is equal to 3 (b11) in subframe 4, pages 11-24. In this case, the subframe 5 page (11-24) in that same frame will correspond to the information in sections 5.2.4.14, 5.2.4.15 and 5.2.4.17. AmEpID can be set to 3 for other pages, but it doesn't seem to carry a meaning in that context.
With respect to validity checking, the following checks are performed:
The following data are discarded and never returned due to the fact that attempting to provide the data to users would result in exceptions and other software internal errors:
Currently ignored:
Definition at line 85 of file PNBBDSD2NavDataFactory.hpp.
#include <PNBBDSD2NavDataFactory.hpp>
Classes | |
class | AmEpID |
Store transmit time and corresponding AmEpID for amEpIDMap. More... | |
Static Public Member Functions | |
static bool | isAlmDefault (const PackedNavBitsPtr &navIn) |
Protected Types | |
typedef std::shared_ptr< BDSD2NavAlm > | AlmPtr |
Alias for almanac objects. More... | |
typedef std::list< AlmPtr > | AlmPtrList |
Alias for list of almanac objects. More... | |
Protected Member Functions | |
bool | finishAlm (AlmPtr &alm, bool fromWNa, const NavSatelliteID &key, NavDataPtrList &navOut) |
void | finishAlm (bool fromWNa, const NavSatelliteID &key, NavDataPtrList &navOut) |
void | makeHealth (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut, unsigned long subjID, unsigned startBit1, unsigned numBits1, unsigned startBit2=0, unsigned numBits2=0) |
Protected Attributes | |
std::map< NavSatelliteID, AlmPtrList > | almAcc |
std::map< NavSatelliteID, AmEpID > | amEpIDMap |
std::map< NavSatelliteID, std::vector< PackedNavBitsPtr > > | ephAcc |
std::map< unsigned, BDSWeekSecond > | fullWNaMap |
std::map< NavSatelliteID, uint16_t > | heaAcc |
![]() | |
FactoryControl | factControl |
Configuration for the behavior of this factory. More... | |
NavValidityType | navValidity |
Determines how the factory should filter added data. More... | |
bool | processAlm |
If true, almanac data will be output by addData. More... | |
bool | processEph |
If true, ephemeris data will be output by addData. More... | |
bool | processHea |
If true, health data will be output by addData. More... | |
bool | processIono |
If true, ionospheric data will be output by addData. More... | |
bool | processISC |
If true, inter-signal correction data will be output by addData. More... | |
bool | processTim |
If true, time offset data will be output by addData. More... | |
|
protected |
Alias for almanac objects.
Definition at line 227 of file PNBBDSD2NavDataFactory.hpp.
|
protected |
Alias for list of almanac objects.
Definition at line 229 of file PNBBDSD2NavDataFactory.hpp.
|
overridevirtual |
Process a PackedNavBits object, producing NavData objects as appropriate.
[in] | navIn | The PackedNavBits data to process. |
[out] | navOut | Any resulting NavData objects that were completed, usually as a result of adding navIn to the set of data. |
[in] | cadence | This value is ignored in this class. |
Implements gnsstk::PNBNavDataFactory.
Definition at line 71 of file PNBBDSD2NavDataFactory.cpp.
void gnsstk::PNBBDSD2NavDataFactory::dumpState | ( | std::ostream & | s | ) | const |
For debugging purposes, dump the sizes of the accumulator maps.
[in,out] | s | The stream to write the debug output to. |
Definition at line 976 of file PNBBDSD2NavDataFactory.cpp.
|
inline |
Return true if a0 and a1 are zero and double 0 filtering is enabled.
Definition at line 197 of file PNBBDSD2NavDataFactory.hpp.
|
protected |
Attempt to complete a single almanac object.
[in,out] | alm | A single almanac to potentially complete (set the "Toe"/"Toc" which are really the toa, health and fit interval). |
[in] | fromWNa | If true, this function is being called after processing subframe 5 page 8, which contains the WNa, which results in special processing. |
[in] | key | The key used to look up the WNa for the almanac (the NavSatelliteID with the subject sat set to 0). |
[out] | navOut | Any completed almanacs will be stored in here. |
Definition at line 909 of file PNBBDSD2NavDataFactory.cpp.
|
protected |
Search through the internal store of almanac data for almanacs that can be completed.
[in] | fromWNa | If true, this function is being called after processing subframe 5 page 8, which contains the WNa, which results in special processing. |
[in] | key | The key used to look up the WNa for the almanac (the NavSatelliteID with the subject sat set to 0). |
[out] | navOut | Any completed almanacs will be stored in here. |
Definition at line 889 of file PNBBDSD2NavDataFactory.cpp.
|
static |
Determine if a given page contains default data.
[in] | navIn | The as-broadcast bits. |
Definition at line 863 of file PNBBDSD2NavDataFactory.cpp.
|
protected |
Create a BDSD2NavHealth object from the 9 bits of almanac health data. This method can be used for consecutive bits by specifying startBit2=0 and numBits2=0. Otherwise, if the health bits are split into to pieces, startBit1/2 and numBits1/2 are both used.
[in] | navIn | The as-broadcast bits. |
[out] | navOut | A BDSD2NavAlm object is added to this list (no checking is done at this level to see if health objects are desired). |
[in] | subjID | The PRN ID of the satellite to which these health bits pertain. |
[in] | startBit1 | The first bit in navIn containing the MSBs of the health information. |
[in] | numBits1 | The number of bits in the MSB portion of the health bits. |
[in] | startBit2 | The first bit in navIn containing the LSBs of the health information. |
[in] | numBits2 | The number of bits in the LSB portion of the health bits. |
Definition at line 832 of file PNBBDSD2NavDataFactory.cpp.
bool gnsstk::PNBBDSD2NavDataFactory::processAlm | ( | unsigned | pnum, |
const PackedNavBitsPtr & | navIn, | ||
NavDataPtrList & | navOut | ||
) |
Process almanac messages. An almanac is placed in navOut, if such processing is enabled.
[in] | pnum | The page number (1-120) pertaining to navIn. |
[in] | navIn | The as-broadcast almanac bits. |
[out] | navOut | If an almanac is completed and the data is requested, this will contain a BDSD2NavAlm object. |
Definition at line 167 of file PNBBDSD2NavDataFactory.cpp.
bool gnsstk::PNBBDSD2NavDataFactory::processEph | ( | unsigned long | pgid, |
const PackedNavBitsPtr & | navIn, | ||
NavDataPtrList & | navOut | ||
) |
Process ephemeris messages. A combination of ephemeris, iono and ISC objects are placed in navOut, depending on the type filter settings and input subframe.
[in] | pgid | Page number (1-10) of the input data. |
[in] | navIn | The as-broadcast ephemeris bits. |
[out] | navOut | If an ephemeris is completed and the data is requested, this will contain a BDSD2NavEph object. If the input is subframe 1 and data is requested, this will contain BDSD2NavIono and/or BDSD2NavISC objects. |
Definition at line 302 of file PNBBDSD2NavDataFactory.cpp.
bool gnsstk::PNBBDSD2NavDataFactory::processSF5Pg101 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 101 which contains time offsets between BeiDou and other GNSSes.
[in] | navIn | The as-broadcast bits. |
[out] | navOut | If time offset data is requested, this will contain multiple time offset objects. |
Definition at line 656 of file PNBBDSD2NavDataFactory.cpp.
bool gnsstk::PNBBDSD2NavDataFactory::processSF5Pg102 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 102 which contains the time offset between BeiDou and UTC.
[in] | navIn | The as-broadcast bits. |
[out] | navOut | If time offset data is requested, this will contain a single time offset object. |
Definition at line 730 of file PNBBDSD2NavDataFactory.cpp.
bool gnsstk::PNBBDSD2NavDataFactory::processSF5Pg116 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 116 which may contain health data for the extended constellation. This data is only present when the AmEpID bits are set to 3 and the AmID bits in this subframe 5 are non-zero.
[in] | navIn | The as-broadcast bits. |
[out] | navOut | If an almanac is completed and the data is requested, this will contain one or more BDSD2NavAlm objects. If health data is requested, this will contain multiple health objects. |
Definition at line 776 of file PNBBDSD2NavDataFactory.cpp.
bool gnsstk::PNBBDSD2NavDataFactory::processSF5Pg35 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 35 which contains health data.
[in] | navIn | The as-broadcast bits. |
[out] | navOut | If an almanac is completed and the data is requested, this will contain one or more BDSD2NavAlm objects. If health data is requested, this will contain multiple health objects. |
Definition at line 558 of file PNBBDSD2NavDataFactory.cpp.
bool gnsstk::PNBBDSD2NavDataFactory::processSF5Pg36 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 36 which contains health data as well as the WNa for almanacs.
[in] | navIn | The as-broadcast bits. |
[out] | navOut | If an almanac is completed and the data is requested, this will contain one or more BDSD2NavAlm objects. If health data is requested, this will contain multiple health objects. |
Definition at line 597 of file PNBBDSD2NavDataFactory.cpp.
|
overridevirtual |
Reset the state of the data accumulator. Most PNBNavDataFactory child classes will maintain some state to assemble data prior to processing. This method is intended to be used to clear out that intermediate data to start from a fresh state, e.g. if you're loading discontinuous data.
Implements gnsstk::PNBNavDataFactory.
Definition at line 880 of file PNBBDSD2NavDataFactory.cpp.
|
protected |
Accumulate almanac orbital element pages (sf 4 pg 1-24, sf 5 pg 1-6) until a page sf 5 pg 8 becomes available to properly set the WNa. Key is the transmitting PRN (only xmitSat is set, sat is ignored).
Definition at line 237 of file PNBBDSD2NavDataFactory.hpp.
|
protected |
Keep track of the most recent AmEpID for a given NavSatelliteID. This allows us to determine whether or not to emit an almanac for subframe 5, pages 11-23, or health for subframe 5, page 24.
Definition at line 242 of file PNBBDSD2NavDataFactory.hpp.
|
protected |
Map PRN to a vector of PackedNavBits for accumulating ephemeris data, where index 0 is subframe 1 and so on.
Definition at line 245 of file PNBBDSD2NavDataFactory.hpp.
|
protected |
Map transmit PRN to fully qualified week/second (WNa/toa). This is set by sf 5 pg 8.
Definition at line 232 of file PNBBDSD2NavDataFactory.hpp.
|
protected |
Map PRN to health status to use in almanac objects. The data are pulled from sf 5, pg 7-8. Unfortunately, only pg 8 has toa in it, so really about the best we can do is store the most recent health bits and use them.
Definition at line 250 of file PNBBDSD2NavDataFactory.hpp.