Public Member Functions | Protected Attributes | List of all members
gnsstk::PNBGPSLNavDataFactory Class Reference

Detailed Description

This class provides a factory that processes PackedNavBits data containing GPS LNav (Legacy Nav, aka data ID 2) data as defined in IS-GPS-200 section 20. The results of the addData method (in the navOut argument) may contain any number of GPSLNavAlm, GPSLNavEph, GPSLNavHealth or GPSLNavTimeOffset objects, according to what data is fed to the method and what data is requested via the validity and type filters (see PNBNavDataFactory).

Note
Currently validity is not checked in any way in this class.
This class does not enforce sequential subframes in ephemerides.
Todo:
Currently this code enforces strict matching of toa between SVID 1-32 and 51. While this helps ensure that the time stamp of the almanac orbital elements has the correct week number, it does mean that if you're missing the page 51 for a particular toa, you won't get those almanacs. This is probably not ideal and likely needs to be enhanced without significantly increasing the risk of using an incorrect WNa.

Definition at line 69 of file PNBGPSLNavDataFactory.hpp.

#include <PNBGPSLNavDataFactory.hpp>

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

Public Member Functions

bool addData (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut, double cadence=-1) override
 
void dumpState (std::ostream &s) const
 
bool processAlmOrb (unsigned long prn, const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processEph (unsigned sfid, const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processSVID51 (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processSVID56 (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processSVID63 (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)
 

Protected Attributes

std::map< NavSatelliteID, NavDataPtrListalmAcc
 
std::map< NavSatelliteID, std::vector< PackedNavBitsPtr > > ephAcc
 
std::map< unsigned, GPSWeekSecondfullWNaMap
 
- 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 Function Documentation

◆ addData()

bool gnsstk::PNBGPSLNavDataFactory::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:
maybe someday add a parity check to PackedNavBits
Todo:
Are the nav subframes really known to be upright?
Todo:
support GPS PRNs 33+ (IS-GPS-200 40.1, appendix IV)

Implements gnsstk::PNBNavDataFactory.

Definition at line 56 of file PNBGPSLNavDataFactory.cpp.

◆ dumpState()

void gnsstk::PNBGPSLNavDataFactory::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 756 of file PNBGPSLNavDataFactory.cpp.

◆ processAlmOrb()

bool gnsstk::PNBGPSLNavDataFactory::processAlmOrb ( unsigned long  prn,
const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process SV/page ID 1-32. In order for GPSLNavAlm data to be produced, SV/page ID 51 must have been processed. This is required in order to get the almanac week (WNa). If page 51 has not yet been processed, the almanac orbital elements are stored in almAcc until such time as a page 51 is processed.

Parameters
[in]prnThe SV/page ID which represents the subject PRN.
[in]navInThe PackedNavBits data containing the subframe.
[out]navOutThe GPSLNavAlm and/or GPSLNavHealth objects generated from navIn.
Returns
true if successful (navOut may still be empty).
Todo:
determine if this offset applies only when the subject satellite is QZSS or if it is used whenever the transmitting satellite is QZSS.

Definition at line 371 of file PNBGPSLNavDataFactory.cpp.

◆ processEph()

bool gnsstk::PNBGPSLNavDataFactory::processEph ( unsigned  sfid,
const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process subframes 1-3. When a complete ephemeris of subframes 1,2,3 and consistent IODE/IODC are accumulated in ephAcc, that ephemeris is placed in navOut.

Parameters
[in]sfidThe subframe ID (1-3) pertaining to navIn.
[in]navInThe as-broadcast ephemeris subframe bits.
[out]navOutIf an ephemeris is completed, this will contain a GPSLNavEph object.
Returns
false on error.

Definition at line 177 of file PNBGPSLNavDataFactory.cpp.

◆ processSVID51()

bool gnsstk::PNBGPSLNavDataFactory::processSVID51 ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process SV/page ID 51. This includes health data for PRNs 1-24 as well as the WNa. This will likely result in the generation of both GPSLNavHealth (24 of them) as well as a set of GPSLNavAlm objects as the almanac structure means page 51 is always last.

Parameters
[in]navInThe PackedNavBits data containing the subframe.
[out]navOutThe GPSLNavAlm and/or GPSLNavHealth objects generated from navIn.
Returns
true if successful (navOut may still be empty).
Todo:
Should we be generating health objects for both PRN 196 and 203, for example? It's not entirely clear from the table if the PRN should be 196 for L1 C/A and 203 for L1 C/B, or if the health status applies to both at the same time.

Definition at line 477 of file PNBGPSLNavDataFactory.cpp.

◆ processSVID56()

bool gnsstk::PNBGPSLNavDataFactory::processSVID56 ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process SV/page ID 56. This includes GPS-UTC time offset data and ionospheric corrections.

Parameters
[in]navInThe PackedNavBits data containing the subframe.
[out]navOutThe GPSLNavTimeOffset object generated from navIn.
Returns
true if successful.
Note
while some of the values are stored as doubles, they may be extracted as long (e.g. deltatLS) because there is no scaling for the encoded value.

Definition at line 671 of file PNBGPSLNavDataFactory.cpp.

◆ processSVID63()

bool gnsstk::PNBGPSLNavDataFactory::processSVID63 ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process SV/page ID 63. This includes health data for PRNs 25-32.

Parameters
[in]navInThe PackedNavBits data containing the subframe.
[out]navOutThe GPSLNavHealth objects generated from navIn.
Returns
true if successful.

Definition at line 596 of file PNBGPSLNavDataFactory.cpp.

◆ resetState()

void gnsstk::PNBGPSLNavDataFactory::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 785 of file PNBGPSLNavDataFactory.cpp.

Member Data Documentation

◆ almAcc

std::map<NavSatelliteID, NavDataPtrList> gnsstk::PNBGPSLNavDataFactory::almAcc
protected

Accumulate almanac orbital element pages (page ID 1-32) until a page ID 51 becomes available to properly set the WNa. Key is the transmitting PRN (only xmitSat is set, sat is ignored).

Definition at line 156 of file PNBGPSLNavDataFactory.hpp.

◆ ephAcc

std::map<NavSatelliteID, std::vector<PackedNavBitsPtr> > gnsstk::PNBGPSLNavDataFactory::ephAcc
protected

Map GPS PRN to a vector of PackedNavBits for accumulating ephemeris data, where index 0 is subframe 1 and so on.

Definition at line 159 of file PNBGPSLNavDataFactory.hpp.

◆ fullWNaMap

std::map<unsigned, GPSWeekSecond> gnsstk::PNBGPSLNavDataFactory::fullWNaMap
protected

Map GPS transmit PRN to fully qualified week/second (WNa/toa). This is set by SV/page ID 51.

Definition at line 151 of file PNBGPSLNavDataFactory.hpp.


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


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