pavi  0.0
Map Path Viewer
NMEA Class Reference

NMEA parser UDT (class with working code in CTOR) More...

Collaboration diagram for NMEA:

Public Member Functions

 NMEA (BYVAL_AS_TrackLoader_PTR)
 CTOR parsing the context of a *.NMEA file. More...
 
FUNCTION_AS_float Val_ (BYVAL_AS_ZSTRING_PTR)
 Evaluate a number from a string. More...
 
FUNCTION_AS_TrP_PTR Eval (BYVAL_AS_ZSTRING_PTR_PTR)
 Evaluate the lines data. More...
 
FUNCTION_AS_DOUBLE LaLo (BYVAL_AS_ZSTRING_PTR_PTR)
 Evaluate longitude or latitude from text. More...
 
FUNCTION_AS_DOUBLE DaTi (BYVAL_AS_ZSTRING_PTR_PTR)
 Evaluate the date and time for input lines. More...
 

Public Attributes

LONG Lin = 0
 lines/tags counter More...
 
LONG Enr = 0
 error counter More...
 
ANY_PTR Dat
 end of data array in input buffer More...
 
ZSTRING_PTR Tok [27+1]
 

Detailed Description

NMEA parser UDT (class with working code in CTOR)

This UDTs constructor gets the context of a *.NMEA file and evaluates it, reading the date, time, longitude, latitude, elevation, ground speed and the moving direction data from a set of two lines ($GPGGA and $GPRMC). The code is tested for files generated by MapFactor Navigator software.

Since
0.0

Definition at line 20 of file parser_nmea.bi.

Constructor & Destructor Documentation

◆ NMEA()

NMEA::NMEA ( BYVAL_AS_TrackLoader_PTR  Par)

CTOR parsing the context of a *.NMEA file.

Parameters
ParPointer to parent instance

This constructor gets an input buffer (UBYTE PTR) containing the context of an *.NMEA file, and parses it, creating an array of TrP points if

a $GPRMC line follows a $GPGGA data line both lines contain the same timestamp and position both lines have a valid checksum

If a single $GPGGA line or a pair of $GPGGA and $GPRMC lines doesn't match this requiaries, they get skipped.

Otherwise a new TrP gets created for the pair of lines, and that TrP gets stored in the resulting TrP array, located at (and overriding) the beginning of the input buffer.

Invalid or missing numbers get filled by NaN entries.

Find the data field description at https://de.wikipedia.org/wiki/NMEA_0183

Since
0.0

Definition at line 40 of file parser_nmea.bas.

Here is the call graph for this function:

Member Function Documentation

◆ Val_()

FUNCTION_AS_float NMEA::Val_ ( BYVAL_AS_ZSTRING_PTR  S)

Evaluate a number from a string.

Parameters
SThe string context
Returns
The number (float)

Function to read a float number from a string. Independant from the locale setting it always uses the . character as decimal separator (unlike the FB VAL function).

Since
0.0

Definition at line 87 of file parser_nmea.bas.

Here is the caller graph for this function:

◆ Eval()

FUNCTION_AS_TrP_PTR NMEA::Eval ( BYVAL_AS_ZSTRING_PTR_PTR  S)

Evaluate the lines data.

Parameters
Sstart of entry strings (array of ZSTRING PTR)
Returns
location of new result (TrP array) entry

This function checks the location in both lines. In case of a mismatch it skips the lines (a point). Otherwise it creates a further entry in the output array.

Since
0.0

< Date / Time

< Latitude [radians]

< Longitude [radians]

< Elevation [m]

< Speed over ground [km/h]

< Direction Angle [degree]

Definition at line 150 of file parser_nmea.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LaLo()

FUNCTION_AS_DOUBLE NMEA::LaLo ( BYVAL_AS_ZSTRING_PTR_PTR  S)

Evaluate longitude or latitude from text.

Parameters
SStart of number, followed by direction (N, W, S, E)
Returns
The world angle in radians (or NaN)

Function to evaluate an longitude or latitude entry. It gets a first ZSTRING PTR pointing to the number (like 01821.7380), and a second pointing to the direction (like E). Both are concidered to compute the matching world angle in radians, returning NaN in case of invalid direction.

Since
0.0

Definition at line 130 of file parser_nmea.bas.

Here is the caller graph for this function:

◆ DaTi()

FUNCTION_AS_DOUBLE NMEA::DaTi ( BYVAL_AS_ZSTRING_PTR_PTR  S)

Evaluate the date and time for input lines.

Parameters
SThe array all parameters
Returns
A FreeBASIC DATE_TIME_SERIAL (DOUBLE)

Function that checks the time in both lines, returning a NaN in case of a mismatch. Otherwise it returns a DOUBLE containing an FB DATE_TIME_SERIAL.

Since
0.0

Definition at line 103 of file parser_nmea.bas.

Here is the caller graph for this function:

Member Data Documentation

◆ Lin

LONG NMEA::Lin = 0

lines/tags counter

Definition at line 22 of file parser_nmea.bi.

◆ Enr

LONG NMEA::Enr = 0

error counter

Definition at line 23 of file parser_nmea.bi.

◆ Dat

ANY_PTR NMEA::Dat

end of data array in input buffer

Definition at line 25 of file parser_nmea.bi.

◆ Tok

ZSTRING_PTR NMEA::Tok[27+1]

Definition at line 26 of file parser_nmea.bi.


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