This class provides a factory that processes PackedNavBits data containing BeiDou D1 NAV data as defined in the BeiDou ICD. The results of the addData method (in the navOut argument) may contain any number of BDSD1NavAlm, BDSD1NavEph, BDSD1NavHealth or BDSD1NavTimeOffset objects, according to what data is fed to the method and what data is requested via the validity and type filters (see PNBNavDataFactory).
The D1 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:
Definition at line 81 of file PNBBDSD1NavDataFactory.hpp.
#include <PNBBDSD1NavDataFactory.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< BDSD1NavAlm > | 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 208 of file PNBBDSD1NavDataFactory.hpp.
|
protected |
Alias for list of almanac objects.
Definition at line 210 of file PNBBDSD1NavDataFactory.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 64 of file PNBBDSD1NavDataFactory.cpp.
void gnsstk::PNBBDSD1NavDataFactory::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 952 of file PNBBDSD1NavDataFactory.cpp.
|
protected |
Attempt to complete a single almanac object.
[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 885 of file PNBBDSD1NavDataFactory.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 865 of file PNBBDSD1NavDataFactory.cpp.
|
static |
Determine if a given page contains default data.
[in] | navIn | The as-broadcast bits. |
Definition at line 839 of file PNBBDSD1NavDataFactory.cpp.
|
protected |
Create a BDSD1NavHealth 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 BDSD1NavAlm 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 808 of file PNBBDSD1NavDataFactory.cpp.
bool gnsstk::PNBBDSD1NavDataFactory::processAlm | ( | unsigned long | sfid, |
unsigned | pnum, | ||
const PackedNavBitsPtr & | navIn, | ||
NavDataPtrList & | navOut | ||
) |
Process almanac messages. An almanac is placed in navOut, if such processing is enabled.
[in] | sfid | Subframe ID (4 or 5). |
[in] | pnum | The page number (1-24) 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 BDSD1NavAlm object. |
Definition at line 171 of file PNBBDSD1NavDataFactory.cpp.
bool gnsstk::PNBBDSD1NavDataFactory::processEph | ( | unsigned long | sfid, |
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] | sfid | Subframe ID (1-3). |
[in] | navIn | The as-broadcast ephemeris bits. |
[out] | navOut | If an ephemeris is completed and the data is requested, this will contain a BDSD1NavEph object. If the input is subframe 1 and data is requested, this will contain BDSD1NavIono and/or BDSD1NavISC objects. |
Definition at line 315 of file PNBBDSD1NavDataFactory.cpp.
bool gnsstk::PNBBDSD1NavDataFactory::processSF5Pg10 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 10 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 706 of file PNBBDSD1NavDataFactory.cpp.
bool gnsstk::PNBBDSD1NavDataFactory::processSF5Pg24 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 24 which may contain health data for the extended constellation. This data is only present when the subframe 4 broadcast immediately prior to this subframe 5 has the AmEpID bits 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 BDSD1NavAlm objects. If health data is requested, this will contain multiple health objects. |
Definition at line 752 of file PNBBDSD1NavDataFactory.cpp.
bool gnsstk::PNBBDSD1NavDataFactory::processSF5Pg7 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 7 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 BDSD1NavAlm objects. If health data is requested, this will contain multiple health objects. |
Definition at line 534 of file PNBBDSD1NavDataFactory.cpp.
bool gnsstk::PNBBDSD1NavDataFactory::processSF5Pg8 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 8 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 BDSD1NavAlm objects. If health data is requested, this will contain multiple health objects. |
Definition at line 573 of file PNBBDSD1NavDataFactory.cpp.
bool gnsstk::PNBBDSD1NavDataFactory::processSF5Pg9 | ( | const PackedNavBitsPtr & | navIn, |
NavDataPtrList & | navOut | ||
) |
Process subframe 5 page 9 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 632 of file PNBBDSD1NavDataFactory.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 856 of file PNBBDSD1NavDataFactory.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 218 of file PNBBDSD1NavDataFactory.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 223 of file PNBBDSD1NavDataFactory.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 226 of file PNBBDSD1NavDataFactory.hpp.
|
protected |
Map transmit PRN to fully qualified week/second (WNa/toa). This is set by sf 5 pg 8.
Definition at line 213 of file PNBBDSD1NavDataFactory.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 231 of file PNBBDSD1NavDataFactory.hpp.