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

Detailed Description

This class provides a factory that processes PackedNavBits data containing GLONASS FDMA civil nav data as defined in the GLONASS (FDMA) ICD. The results of the addData method (in the navOut argument) may contain any number of GLOFNavAlm, GLOFNavEph, GLOFNavHealth, GLOFNavISC, GLOFNavTimeOffset or GLOFNavUT1TimeOffset objects, according to what data is fed to the method and what data is requested via the validity and type filters (see PNBNavDataFactory).

Definition at line 59 of file PNBGLOFNavDataFactory.hpp.

#include <PNBGLOFNavDataFactory.hpp>

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

Classes

class  TimeMeta
 Class to store fields used to turn GLONASS into UT1. More...
 

Public Member Functions

bool addData (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut, double cadence=-1) override
 
unsigned getFrameNum (const CommonTime &xmitTime)
 
 PNBGLOFNavDataFactory ()
 Initialize data members. More...
 
bool processAlm (unsigned long stringID, const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processAlmOrb (const NavSatelliteID &key, unsigned almIdx, NavDataPtrList &navOut)
 
bool processEph (unsigned long stringID, const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processTime (const PackedNavBitsPtr &navIn, NavDataPtrList &navOut)
 
bool processTimeUT1 (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 validSize (const PackedNavBitsPtr &navIn)
 Return true if the PNB is 85 or 96 bits. More...
 

Protected Attributes

std::map< NavSatelliteID, std::vector< PackedNavBitsPtr > > almAcc
 
CommonTime almDOY
 Used to set the reference almanac time. More...
 
BasicTimeSystemConverter btsc
 Used to convert time stamps to and from GLONASS. More...
 
std::map< NavSatelliteID, std::vector< PackedNavBitsPtr > > ephAcc
 
bool pendingAlms
 
std::map< NavSatelliteID, TimeMetatimeAcc
 
- 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...
 

Constructor & Destructor Documentation

◆ PNBGLOFNavDataFactory()

gnsstk::PNBGLOFNavDataFactory::PNBGLOFNavDataFactory ( )

Initialize data members.

Definition at line 59 of file PNBGLOFNavDataFactory.cpp.

Member Function Documentation

◆ addData()

bool gnsstk::PNBGLOFNavDataFactory::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, if there is any.

Everything else is almanac

Implements gnsstk::PNBNavDataFactory.

Definition at line 67 of file PNBGLOFNavDataFactory.cpp.

◆ getFrameNum()

unsigned gnsstk::PNBGLOFNavDataFactory::getFrameNum ( const CommonTime xmitTime)

Compute the frame number given the transmit time of a string.

Parameters
[in]xmitTimeThe transmit time of a nav string.
Returns
the decoded frame number (1-5).
Exceptions
AssertionFailureif unable to convert the time system of xmitTime to GLO.

Definition at line 592 of file PNBGLOFNavDataFactory.cpp.

◆ processAlm()

bool gnsstk::PNBGLOFNavDataFactory::processAlm ( unsigned long  stringID,
const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process strings 6-15. When a complete set of almanac orbital elements (e.g. page 6+7) with consecutive time stamps is accumulated in almAcc, that almanac is placed in navOut. If requested, health will also be added to navOut.

Note
This method stores data in almAcc.
Parameters
[in]stringIDThe string ID (6-15) pertaining to navIn.
[in]navInThe as-broadcast almanac bits.
[out]navOutIf an almanac is completed and the data is requested, this will contain a GLOFNavAlm object. If an almanac is completed and health data is requested, it will contain a GLOFNavHealth object.
Returns
false on error.
Todo:
Should we process the transmit satellite health here?

Definition at line 331 of file PNBGLOFNavDataFactory.cpp.

◆ processAlmOrb()

bool gnsstk::PNBGLOFNavDataFactory::processAlmOrb ( const NavSatelliteID key,
unsigned  almIdx,
NavDataPtrList navOut 
)

Process strings 6-15. When a complete set of almanac orbital elements (e.g. page 6+7) with consecutive time stamps is accumulated in almAcc, that almanac is placed in navOut. If requested, health will also be added to navOut.

Note
This method operates only on data already present in almAcc.
Parameters
[in]keyAn unique identifier for the transmitting signal, used as a hash for almAcc.
[in]almIdxThe array index into the almAcc collection for this satellite/signal (expected to be even numbers from 0..8).
[out]navOutIf an almanac is completed and the data is requested, this will contain a GLOFNavAlm object. If an almanac is completed and health data is requested, it will contain a GLOFNavHealth object.
Returns
false on error.

Definition at line 377 of file PNBGLOFNavDataFactory.cpp.

◆ processEph()

bool gnsstk::PNBGLOFNavDataFactory::processEph ( unsigned long  stringID,
const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process strings 1-4. When a complete ephemeris of strings 1-4 with consecutive time stamps is accumulated in ephAcc, that ephemeris is placed in navOut. An ISC and/or health object may also be added to navOut when available and such processing is enabled.

Parameters
[in]stringIDThe string ID (1-4) pertaining to navIn.
[in]navInThe as-broadcast ephemeris bits.
[out]navOutIf an ephemeris is completed and requested, this will contain a GLOFNavEph object. If navIn contains string 4 and ISC data is requested, navOut will contain a GLOFNavISC object. If an ephemeris is completed and health data is requested, navOut will contain a GLOFNavHealth object.
Returns
false on error.
Todo:
Maybe make it so we can still get the health w/o strings 1&4
Todo:
I think reference time is referenced to the start of the transmit day, but is that true?
Bug:
This doesn't seem right, adding a day to seconds of day then subtracting? Shouldn't it just be subtracting 3 hours (10800 seconds from the CommonTime object once constructed?

Definition at line 144 of file PNBGLOFNavDataFactory.cpp.

◆ processTime()

bool gnsstk::PNBGLOFNavDataFactory::processTime ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process string 5. If requested, any of health, almanac, or time offset data may be placed in navOut.

Parameters
[in]navInThe as-broadcast string 5 bits.
[out]navOutIf an almanac is completed and the data is requested, this will contain a GLOFNavAlm object. If health data is requested, it will contain a GLOFNavHealth object. If time offsets are requested, it will contain a GLOFNavTimeOffset object.
Returns
false on error.
Bug:
Table 4.9 in the ICD suggests there are two sets of scales and number of bits, one for legacy GLONASS and one for GLONASS-M, but it doesn't say if tau_c starts at the same bit position in legacy. Another implementation always uses the -M bit pattern. It's not clear what's correct.
Bug:
This is a bit sketchy because it relies on the hard-coded integer leap seconds in gnsstk::getLeapSeconds(), but I can't think of a more reliable way to get this data here at the moment. Luckily changes are few and far between.

Definition at line 486 of file PNBGLOFNavDataFactory.cpp.

◆ processTimeUT1()

bool gnsstk::PNBGLOFNavDataFactory::processTimeUT1 ( const PackedNavBitsPtr navIn,
NavDataPtrList navOut 
)

Process string 14, frame 5. If requested, UT1 time offset data will be placed in navOut.

Note
This method does not check the string or frame numbers. That must be done previously by the caller.
Parameters
[in]navInThe as-broadcast string 14, frame 5 bits.
[out]navOutIf time offset data is requested and the almanac reference time from string 5 has been loaded, this will contain a GLOFNavUT1TimeOffset object.
Returns
false on error.
Todo:
determine if this data is only in GLONASS-M

Definition at line 565 of file PNBGLOFNavDataFactory.cpp.

◆ resetState()

void gnsstk::PNBGLOFNavDataFactory::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 608 of file PNBGLOFNavDataFactory.cpp.

◆ validSize()

static bool gnsstk::PNBGLOFNavDataFactory::validSize ( const PackedNavBitsPtr navIn)
inlinestatic

Return true if the PNB is 85 or 96 bits.

Definition at line 168 of file PNBGLOFNavDataFactory.hpp.

Member Data Documentation

◆ almAcc

std::map<NavSatelliteID, std::vector<PackedNavBitsPtr> > gnsstk::PNBGLOFNavDataFactory::almAcc
protected

Map GLONASS satellite ID to a vector of PackedNavBits for accumulating almanac data, where index 0 is string 6 and so on.

Definition at line 208 of file PNBGLOFNavDataFactory.hpp.

◆ almDOY

CommonTime gnsstk::PNBGLOFNavDataFactory::almDOY
protected

Used to set the reference almanac time.

Definition at line 216 of file PNBGLOFNavDataFactory.hpp.

◆ btsc

BasicTimeSystemConverter gnsstk::PNBGLOFNavDataFactory::btsc
protected

Used to convert time stamps to and from GLONASS.

Definition at line 214 of file PNBGLOFNavDataFactory.hpp.

◆ ephAcc

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

Map GLONASS satellite ID to a vector of PackedNavBits for accumulating ephemeris data, where index 0 is string 1 and so on.

Definition at line 204 of file PNBGLOFNavDataFactory.hpp.

◆ pendingAlms

bool gnsstk::PNBGLOFNavDataFactory::pendingAlms
protected

Set to true if there are pending almanacs waiting on almDOY to be set.

Definition at line 220 of file PNBGLOFNavDataFactory.hpp.

◆ timeAcc

std::map<NavSatelliteID, TimeMeta> gnsstk::PNBGLOFNavDataFactory::timeAcc
protected

Map GLONASS transmit satellite ID to TimeMeta to accumulate complete GLONASS to UT1 time corrections.

Definition at line 200 of file PNBGLOFNavDataFactory.hpp.


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


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