Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | List of all members
gnsstk::EngNav Class Reference

Detailed Description

Base class for ICD-GPS-200 navigation messages. This class provides functions for decoding the bits in navigation message, and is the base class for all "engineering units" types.

Definition at line 69 of file EngNav.hpp.

#include <EngNav.hpp>

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

Public Types

enum  BitConvertType { BITS8 = 0, BITS10 = 1 }
 This enumeration is used by the convertXBit() method. More...
 

Public Member Functions

 EngNav () noexcept
 default constructor More...
 
virtual ~EngNav ()
 destructor More...
 

Static Public Member Functions

static bool checkParity (const std::vector< uint32_t > &v, bool knownUpright=true)
 
static bool checkParity (const uint32_t input[10], bool knownUpright=true)
 
static uint32_t computeParity (uint32_t sfword, uint32_t psfword, bool knownUpright=true)
 
static bool convert10bit (int gpsWeek, double *out) noexcept
 
static bool convert8bit (int gpsWeek, double *out) noexcept
 
static short convertXBit (short fullGPSWeek, short incompleteGPSWeek, BitConvertType type)
 
static void dump (std::ostream &s=std::cout)
 
static uint32_t fixParity (uint32_t sfword, uint32_t psfword, bool nib, bool knownUpright=true)
 
static uint32_t getd29 (uint32_t sfword)
 Get bit 29 from the given subframe word. More...
 
static uint32_t getd30 (uint32_t sfword)
 
static unsigned long getHOWTime (uint32_t word2)
 Get the HOW time from the provided HOW. More...
 
static bool getNMCTValidity (const uint32_t sf2[10], unsigned howWeek, NMCTMeta &meta)
 
static bool getNMCTValidity (const uint32_t sf2[10], unsigned howWeek, uint32_t &aodo, CommonTime &tnmct, CommonTime &toe, CommonTime &tot)
 
static short getSFID (uint32_t word2)
 Get the subframe ID from the provided HOW. More...
 
static short getSubframePattern (const long input[10]) noexcept
 
static short getSubframePattern (const uint32_t input[10]) noexcept
 
static unsigned long getTOW (uint32_t word2)
 Get the TOW count from the provided HOW. More...
 
static bool sfpage2svid (short subframe, short page, short &svpgid) noexcept
 
static bool subframeConvert (const long input[10], int gpsWeek, double output[60]) noexcept
 
static bool subframeConvert (const uint32_t input[10], short gpsWeek, double output[60]) noexcept
 
static bool subframeParity (const long input[10])
 This is the old routine only left around for compatibility. More...
 
static bool sv2page (short svpgid, short &subframe, short &page) noexcept
 
static bool zcount2page (unsigned long zcount, short &subframe, short &page) noexcept
 

Static Private Member Functions

static void convertQuant (const uint32_t input[10], double output[60], const DecodeQuant &dq) noexcept
 

Member Enumeration Documentation

◆ BitConvertType

This enumeration is used by the convertXBit() method.

Enumerator
BITS8 
BITS10 

Definition at line 73 of file EngNav.hpp.

Constructor & Destructor Documentation

◆ EngNav()

gnsstk::EngNav::EngNav ( )
noexcept

default constructor

Definition at line 369 of file EngNav.cpp.

◆ ~EngNav()

virtual gnsstk::EngNav::~EngNav ( )
inlinevirtual

destructor

Definition at line 83 of file EngNav.hpp.

Member Function Documentation

◆ checkParity() [1/2]

bool gnsstk::EngNav::checkParity ( const std::vector< uint32_t > &  v,
bool  knownUpright = true 
)
static

Definition at line 722 of file EngNav.cpp.

◆ checkParity() [2/2]

bool gnsstk::EngNav::checkParity ( const uint32_t  input[10],
bool  knownUpright = true 
)
static

Perform a parity check on a navigation message subframe.

Returns
true if the parity check is successful.

Definition at line 727 of file EngNav.cpp.

◆ computeParity()

uint32_t gnsstk::EngNav::computeParity ( uint32_t  sfword,
uint32_t  psfword,
bool  knownUpright = true 
)
static

Compute and return the parity of the given subframe word, based on the algorihm defined in Section 20.3.5 of IS-GPS-200D.

Parameters
sfwordThe subframe word to compute the parity of.
psfwordThe previous word in the subframe (use 0 when sfword is word 1)
knownUprightWhen this is set, the data is assumed to be upright and no D30 inversion is performed
Returns
the 6-bit parity (or, if zeroBits is set, the 6-bit parity along with the two t-bits, the non-information bits used for parity computation).

Definition at line 637 of file EngNav.cpp.

◆ convert10bit()

bool gnsstk::EngNav::convert10bit ( int  gpsWeek,
double *  out 
)
staticnoexcept

Convert the week number in out from 10-bit to full using the full week number gpsWeek.

Parameters
gpsWeeksource full week number.
out10-bit week number to convert to full
Returns
true if source and target are within 511 weeks of each other.

Definition at line 448 of file EngNav.cpp.

◆ convert8bit()

bool gnsstk::EngNav::convert8bit ( int  gpsWeek,
double *  out 
)
staticnoexcept

Convert the week number in out from 8-bit to full using the full week number gpsWeek.

Parameters
gpsWeeksource full week number.
out8-bit week number to convert to full
Returns
true if source and target are within 127 weeks of each other.

Definition at line 436 of file EngNav.cpp.

◆ convertQuant()

void gnsstk::EngNav::convertQuant ( const uint32_t  input[10],
double  output[60],
const DecodeQuant dq 
)
staticprivatenoexcept

Given 10 words of a navigation message subframe, in, and a structure, p, defining a particular conversion, perform the conversion and store the results in the appropriate location in the output array.

Parameters
[in]inputwords of navigation message subframe. Each nav message word is in the 30 lsbs of the corresponding input[i].
[out]outputarray of 60 doubles. The converted output will be placed in the output array at the location specified in the conversion specification.
[in]dqstructure defining conversion to be performed.
Note
While convertQuant specifies an array of 60 doubles for output, not all of these are always used. The actual number of data that are in output is dependent on the input message format. The indices are defined in the formats array in EngNav.cpp.

Definition at line 742 of file EngNav.cpp.

◆ convertXBit()

short gnsstk::EngNav::convertXBit ( short  fullGPSWeek,
short  incompleteGPSWeek,
BitConvertType  type 
)
static

Convert the week number in out from 8 or 10-bit to full using the full week number fullGPSWeek.

Parameters
fullGPSWeeksource full week number.
incompleteGPSWeekweek number to convert to full
typeBITS8 (0) or BITS10 (1)
Returns
Full GPS week corresponding to incompleteGPSWeek assuming incompleteGPSWeek is within half the 8/10 bit distance from fullGPSWeek.

Definition at line 461 of file EngNav.cpp.

◆ dump()

void gnsstk::EngNav::dump ( std::ostream &  s = std::cout)
static

Emit human-readable instance data to the specified stream.

Parameters
sstream to which data will be written

Definition at line 800 of file EngNav.cpp.

◆ fixParity()

uint32_t gnsstk::EngNav::fixParity ( uint32_t  sfword,
uint32_t  psfword,
bool  nib,
bool  knownUpright = true 
)
static

Compute the parity for the given subframe using the prior subframe and a flag to handle the "non-information bits" that appear in certain words of each subframe.

Parameters
sfwordThe subframe word to compute the parity of.
psfwordThe previous word in the subframe (use 0 when sfword is word 1)
nibif true, sfword is one of the words with the non-information bearing bits (word 2 or 10), and the parity will be computed as appropriate for that situation.
Returns
sfword with the proper parity bits.

Definition at line 685 of file EngNav.cpp.

◆ getd29()

static uint32_t gnsstk::EngNav::getd29 ( uint32_t  sfword)
inlinestatic

Get bit 29 from the given subframe word.

Definition at line 140 of file EngNav.hpp.

◆ getd30()

static uint32_t gnsstk::EngNav::getd30 ( uint32_t  sfword)
inlinestatic

Following two used by checkParity Get bit 30 from the given subframe word

Definition at line 134 of file EngNav.hpp.

◆ getHOWTime()

static unsigned long gnsstk::EngNav::getHOWTime ( uint32_t  word2)
inlinestatic

Get the HOW time from the provided HOW.

Definition at line 146 of file EngNav.hpp.

◆ getNMCTValidity() [1/2]

static bool gnsstk::EngNav::getNMCTValidity ( const uint32_t  sf2[10],
unsigned  howWeek,
NMCTMeta meta 
)
inlinestatic

Get the NMCT validity time from subframe 2. Refer to IS-GPS-200 section 2.3.3.4.4.

Parameters
[in]sf2The 10 words of subframe 2.
[in]howWeekthe GPS full week for the HOW time in sf2.
[in]metaOther metadata pertaining to the NMCT.
Returns
true if the AODO is something other than 27900, which indicates that the NMCT is invalid (i.e. a return value of false means that the other output data is invalid as is the NMCT itself).
Exceptions
InvalidParameterif sf2 is not subframe 2.

Definition at line 361 of file EngNav.hpp.

◆ getNMCTValidity() [2/2]

bool gnsstk::EngNav::getNMCTValidity ( const uint32_t  sf2[10],
unsigned  howWeek,
uint32_t &  aodo,
CommonTime tnmct,
CommonTime toe,
CommonTime tot 
)
static

Get the NMCT validity time from subframe 2. Refer to IS-GPS-200 section 2.3.3.4.4.

Parameters
[in]sf2The 10 words of subframe 2.
[in]howWeekthe GPS full week for the HOW time in sf2.
[out]aodoAge of data offset in seconds.
[out]tnmctThe NMCT validity time.
[out]toeTime of ephemeris.
Returns
true if the AODO is something other than 27900, which indicates that the NMCT is invalid (i.e. a return value of false means that the other output data is invalid as is the NMCT itself).
Exceptions
InvalidParameterif sf2 is not subframe 2.

Definition at line 851 of file EngNav.cpp.

◆ getSFID()

static short gnsstk::EngNav::getSFID ( uint32_t  word2)
inlinestatic

Get the subframe ID from the provided HOW.

Definition at line 163 of file EngNav.hpp.

◆ getSubframePattern() [1/2]

short gnsstk::EngNav::getSubframePattern ( const long  input[10])
staticnoexcept

Given a navigation message subframe, return the pattern number to be used in converting the subframe to engineering units. The patterns are defined in the following table. The numbers correspond to the ordering of the bit definitions in ICD-GPS-200 Figure 20-1.

Subframe # SV_id Pattern # 1 n/a 1 2 n/a 2 3 n/a 3 4 1-24 4 4 25 5 5 57 6 5 58-62 7 5 56 8 5 63 9 5 52-55 10

Parameters
input10 long integers containing the ten words of the navigation message subframe.
Returns
the pattern ID as defined in the above table.

Definition at line 478 of file EngNav.cpp.

◆ getSubframePattern() [2/2]

short gnsstk::EngNav::getSubframePattern ( const uint32_t  input[10])
staticnoexcept

Definition at line 487 of file EngNav.cpp.

◆ getTOW()

static unsigned long gnsstk::EngNav::getTOW ( uint32_t  word2)
inlinestatic

Get the TOW count from the provided HOW.

Definition at line 154 of file EngNav.hpp.

◆ sfpage2svid()

bool gnsstk::EngNav::sfpage2svid ( short  subframe,
short  page,
short &  svpgid 
)
staticnoexcept

Given an SV/Page ID (1-63), set the subframe ID and page passed to the function.

Parameters
subframe(input) the subframe ID of svpgid (4,5)
page(input) the page number of svpgid (1-25)
svpgid(output) the SV/Page ID translated from subframe/page
Returns
false if svpgid was invalid
Note
Some SV/Page IDs are redundant, so the result will be one of the possible pages for that SV/Page ID.

Definition at line 583 of file EngNav.cpp.

◆ subframeConvert() [1/2]

bool gnsstk::EngNav::subframeConvert ( const long  input[10],
int  gpsWeek,
double  output[60] 
)
staticnoexcept

Given 10 words of a navigation message subframe (as defined in ICD-GPS-200), convert to the "appropriate" 60 floating point values.

Parameters
[in]inputarray of ten 30-bit words (stored in the 30 least-significant bits of each long.
[in]gpsWeekfull (>10 bits) GPS week number associated with almanac reference time.
[out]output60 floating point values as defined in the formats array in EngNav.cpp.
Note
While subframeConvert specifies an array of 60 doubles for output, not all of these are always used. The actual number of data that are in output is dependent on the input message format. The indices are defined in the formats array in EngNav.cpp.
Returns
true if successful.

Definition at line 375 of file EngNav.cpp.

◆ subframeConvert() [2/2]

bool gnsstk::EngNav::subframeConvert ( const uint32_t  input[10],
short  gpsWeek,
double  output[60] 
)
staticnoexcept

Given 10 words of a navigation message subframe (as defined in ICD-GPS-200), convert to the "appropriate" 60 floating point values.

Parameters
[in]inputarray of ten 30-bit words (stored in the 30 least-significant bits of each long.
[in]gpsWeekfull (>10 bits) GPS week number associated with almanac reference time.
[out]output60 floating point values as defined in the formats array in EngNav.cpp.
Note
While subframeConvert specifies an array of 60 doubles for output, not all of these are always used. The actual number of data that are in output is dependent on the input message format. The indices are defined in the formats array in EngNav.cpp.
Returns
true if successful.

Definition at line 387 of file EngNav.cpp.

◆ subframeParity()

bool gnsstk::EngNav::subframeParity ( const long  input[10])
static

This is the old routine only left around for compatibility.

This is the OLD GNSSTk method, left here for compatibility.

Definition at line 714 of file EngNav.cpp.

◆ sv2page()

bool gnsstk::EngNav::sv2page ( short  svpgid,
short &  subframe,
short &  page 
)
staticnoexcept

Given an SV/Page ID (1-63), set the subframe ID and page passed to the function.

Parameters
svpgid(input) the SV/Page ID to be translated (typically extracted from subframe 4/5, word 3, bits 3-8 (bit 1=MSB).
subframe(output) the subframe ID of svpgid (4,5)
page(output) the page number of svpgid (1-25)
Returns
false if svpgid was invalid
Note
Some SV/Page IDs are redundant, so the result will be one of the possible pages for that SV/Page ID.

Definition at line 524 of file EngNav.cpp.

◆ zcount2page()

bool gnsstk::EngNav::zcount2page ( unsigned long  zcount,
short &  subframe,
short &  page 
)
staticnoexcept

Given a Z-count representing the TOW in the HOW of a navigation subframe (i.e. TOW * 4), set the subframe ID and page passed to the function.

Parameters
zcount(input) the TOW count, in z-counts, of a nav subframe
subframe(output) the subframe ID of svpgid (4,5)
page(output) the page number of svpgid (1-25)
Returns
false if zcount was invalid

Definition at line 608 of file EngNav.cpp.


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


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