Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
gnsstk::PNBBDSD1NavDataFactory Class Reference

Detailed Description

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>

Inheritance diagram for gnsstk::PNBBDSD1NavDataFactory:
Inheritance graph
[legend]

Classes

class  AmEpID
 Store transmit time and corresponding AmEpID for amEpIDMap. More...
 

Public Member Functions

bool addData (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut, double cadence=-1) override
 
void dumpState (std::ostream &s) const
 
bool processAlm (unsigned long sfid, unsigned pnum, const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processEph (unsigned long sfid, const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processSF5Pg10 (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processSF5Pg24 (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processSF5Pg7 (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processSF5Pg8 (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processSF5Pg9 (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
void resetState () override
 
- Public Member Functions inherited from gnsstk::PNBNavDataFactory
 PNBNavDataFactory ()
 
virtual void setControl (const FactoryControl &ctrl)
 
virtual void setTypeFilter (const NavMessageTypeSet &nmts)
 
virtual void setValidityFilter (NavValidityType nvt)
 

Static Public Member Functions

static bool isAlmDefault (const PackedNavBitsPtr &navIn)
 

Protected Types

typedef std::shared_ptr< BDSD1NavAlmAlmPtr
 Alias for almanac objects. More...
 
typedef std::list< AlmPtrAlmPtrList
 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, AlmPtrListalmAcc
 
std::map< NavSatelliteID, AmEpIDamEpIDMap
 
std::map< NavSatelliteID, std::vector< PackedNavBitsPtr > > ephAcc
 
std::map< unsigned, BDSWeekSecondfullWNaMap
 
std::map< NavSatelliteID, uint16_t > heaAcc
 
- Protected Attributes inherited from gnsstk::PNBNavDataFactory
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...
 

Member Typedef Documentation

◆ AlmPtr

typedef std::shared_ptr<BDSD1NavAlm> gnsstk::PNBBDSD1NavDataFactory::AlmPtr
protected

Alias for almanac objects.

Definition at line 208 of file PNBBDSD1NavDataFactory.hpp.

◆ AlmPtrList

typedef std::list<AlmPtr> gnsstk::PNBBDSD1NavDataFactory::AlmPtrList
protected

Alias for list of almanac objects.

Definition at line 210 of file PNBBDSD1NavDataFactory.hpp.

Member Function Documentation

◆ addData()

bool gnsstk::PNBBDSD1NavDataFactory::addData ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut,
double  cadence = -1 
)
overridevirtual

Process a PackedNavBits object, producing NavData objects as appropriate.

Parameters
[in]navInThe PackedNavBits data to process.
[out]navOutAny resulting NavData objects that were completed, usually as a result of adding navIn to the set of data.
[in]cadenceThis value is ignored in this class.
Returns
false on error.
Todo:
Implement a parity check

Implements gnsstk::PNBNavDataFactory.

Definition at line 64 of file PNBBDSD1NavDataFactory.cpp.

◆ dumpState()

void gnsstk::PNBBDSD1NavDataFactory::dumpState ( std::ostream &  s) const

For debugging purposes, dump the sizes of the accumulator maps.

Parameters
[in,out]sThe stream to write the debug output to.

Definition at line 952 of file PNBBDSD1NavDataFactory.cpp.

◆ finishAlm() [1/2]

bool gnsstk::PNBBDSD1NavDataFactory::finishAlm ( PNBBDSD1NavDataFactory::AlmPtr alm,
bool  fromWNa,
const NavSatelliteID key,
NavDataPtrList navOut 
)
protected

Attempt to complete a single almanac object.

Parameters
[in]fromWNaIf true, this function is being called after processing subframe 5 page 8, which contains the WNa, which results in special processing.
[in]keyThe key used to look up the WNa for the almanac (the NavSatelliteID with the subject sat set to 0).
[out]navOutAny completed almanacs will be stored in here.
Returns
true if the given alm was completed or should be treated as such.
Todo:
see comment in BDSD1NavHealth::getHealth()
Todo:
see comment in BDSD1NavHealth::getHealth()

Definition at line 885 of file PNBBDSD1NavDataFactory.cpp.

◆ finishAlm() [2/2]

void gnsstk::PNBBDSD1NavDataFactory::finishAlm ( bool  fromWNa,
const NavSatelliteID key,
NavDataPtrList navOut 
)
protected

Search through the internal store of almanac data for almanacs that can be completed.

Parameters
[in]fromWNaIf true, this function is being called after processing subframe 5 page 8, which contains the WNa, which results in special processing.
[in]keyThe key used to look up the WNa for the almanac (the NavSatelliteID with the subject sat set to 0).
[out]navOutAny completed almanacs will be stored in here.

Definition at line 865 of file PNBBDSD1NavDataFactory.cpp.

◆ isAlmDefault()

bool gnsstk::PNBBDSD1NavDataFactory::isAlmDefault ( const PackedNavBitsPtr navIn)
static

Determine if a given page contains default data.

Note
This method does not check to see if navIn is an almanac page, only if bits are unset.
Parameters
[in]navInThe as-broadcast bits.
Returns
true if bits 90-289 are unset.

Definition at line 839 of file PNBBDSD1NavDataFactory.cpp.

◆ makeHealth()

void gnsstk::PNBBDSD1NavDataFactory::makeHealth ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut,
unsigned long  subjID,
unsigned  startBit1,
unsigned  numBits1,
unsigned  startBit2 = 0,
unsigned  numBits2 = 0 
)
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.

Parameters
[in]navInThe as-broadcast bits.
[out]navOutA BDSD1NavAlm object is added to this list (no checking is done at this level to see if health objects are desired).
[in]subjIDThe PRN ID of the satellite to which these health bits pertain.
[in]startBit1The first bit in navIn containing the MSBs of the health information.
[in]numBits1The number of bits in the MSB portion of the health bits.
[in]startBit2The first bit in navIn containing the LSBs of the health information.
[in]numBits2The number of bits in the LSB portion of the health bits.

Definition at line 808 of file PNBBDSD1NavDataFactory.cpp.

◆ processAlm()

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.

Parameters
[in]sfidSubframe ID (4 or 5).
[in]pnumThe page number (1-24) pertaining to navIn.
[in]navInThe as-broadcast almanac bits.
[out]navOutIf an almanac is completed and the data is requested, this will contain a BDSD1NavAlm object.
Returns
false on error.

Definition at line 171 of file PNBBDSD1NavDataFactory.cpp.

◆ processEph()

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.

Parameters
[in]sfidSubframe ID (1-3).
[in]navInThe as-broadcast ephemeris bits.
[out]navOutIf 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.
Returns
false on error.

Definition at line 315 of file PNBBDSD1NavDataFactory.cpp.

◆ processSF5Pg10()

bool gnsstk::PNBBDSD1NavDataFactory::processSF5Pg10 ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process subframe 5 page 10 which contains the time offset between BeiDou and UTC.

Parameters
[in]navInThe as-broadcast bits.
[out]navOutIf time offset data is requested, this will contain a single time offset object.
Returns
false on error.

Definition at line 706 of file PNBBDSD1NavDataFactory.cpp.

◆ processSF5Pg24()

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.

Parameters
[in]navInThe as-broadcast bits.
[out]navOutIf 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.
Returns
false on error.

Definition at line 752 of file PNBBDSD1NavDataFactory.cpp.

◆ processSF5Pg7()

bool gnsstk::PNBBDSD1NavDataFactory::processSF5Pg7 ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process subframe 5 page 7 which contains health data.

Parameters
[in]navInThe as-broadcast bits.
[out]navOutIf 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.
Returns
false on error.

Definition at line 534 of file PNBBDSD1NavDataFactory.cpp.

◆ processSF5Pg8()

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.

Parameters
[in]navInThe as-broadcast bits.
[out]navOutIf 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.
Returns
false on error.

Definition at line 573 of file PNBBDSD1NavDataFactory.cpp.

◆ processSF5Pg9()

bool gnsstk::PNBBDSD1NavDataFactory::processSF5Pg9 ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process subframe 5 page 9 which contains time offsets between BeiDou and other GNSSes.

Note
The ICD indicates this is currently unused. As such, the returned data will be marked invalid until real (non-zero) data is broadcast by BeiDou.
Parameters
[in]navInThe as-broadcast bits.
[out]navOutIf time offset data is requested, this will contain multiple time offset objects.
Returns
false on error.
Todo:
figure out what the reference time is supposed to be, which is not a high priority as the ICD itself says "Not broadcast temporarily".

Definition at line 632 of file PNBBDSD1NavDataFactory.cpp.

◆ resetState()

void gnsstk::PNBBDSD1NavDataFactory::resetState ( )
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.

Member Data Documentation

◆ almAcc

std::map<NavSatelliteID, AlmPtrList> gnsstk::PNBBDSD1NavDataFactory::almAcc
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.

◆ amEpIDMap

std::map<NavSatelliteID, AmEpID> gnsstk::PNBBDSD1NavDataFactory::amEpIDMap
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.

◆ ephAcc

std::map<NavSatelliteID, std::vector<PackedNavBitsPtr> > gnsstk::PNBBDSD1NavDataFactory::ephAcc
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.

◆ fullWNaMap

std::map<unsigned, BDSWeekSecond> gnsstk::PNBBDSD1NavDataFactory::fullWNaMap
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.

◆ heaAcc

std::map<NavSatelliteID, uint16_t> gnsstk::PNBBDSD1NavDataFactory::heaAcc
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.


The documentation for this class was generated from the following files:


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:45