pavi  0.0
Map Path Viewer
TrackLoader Class Reference

UDT collecting and holding the track data. More...

Collaboration diagram for TrackLoader:

Public Member Functions

 TrackLoader (BYVAL_AS_CONST_ZSTRING_PTR)
 CTOR loading track data. More...
 
 ~TrackLoader ()
 
FUNCTION_AS_DOUBLE Dist (BYVAL_AS_ULONG, BYVAL_AS_ULONG)
 Compute distance between two points. More...
 
PROPERTY_AS_float LTrk ()
 Compute track length. More...
 
PROPERTY_AS_float ASpd ()
 Compute the speed avarage. More...
 
FUNCTION_AS_BYTE Pixel (BYVAL_AS_LONG, BYVAL_AS_LONG, BYVAL_AS_LONG)
 Compute pixel values for given center and zoom. More...
 
FUNCTION_AS_LONG SkipOut (BYVAL_AS_LONG Typ, BYVAL_AS_float Di)
 Compute exit of cloud. More...
 
SUB MapCenter (BYVAL_AS_LONG W, BYVAL_AS_LONG H)
 Compute center and zoom to plot complete track. More...
 
FUNCTION_AS_float Nearest (BYVAL_AS_float, BYVAL_AS_float)
 Find point nearest to the given [radians] position. More...
 

Public Attributes

ZSTRING_PTR Errr
 error message More...
 
TrP_PTR V
 array of data More...
 
TrP Mx
 maximum values More...
 
TrP Mn
 minimum values More...
 
INTEGER Byt
 bytes read from file (buffer length) More...
 
INTEGER Siz = 0
 byte size of TrackLoader.V array More...
 
LONG Tmp
 temp counter More...
 
LONG Cur
 last track position in map plot More...
 
LONG Az = -1
 number of entries in array TrackLoader.V More...
 
LONG UsZo =-1
 users zoom level in map More...
 
LONG CoZo
 computed zoom level in map More...
 
LONG Co_X
 map-X for computed pixels More...
 
LONG Co_Y
 map-Y for computed pixels More...
 
float UsLo
 users map center latitude (degree) More...
 
float UsLa
 users map center longitude (degree) More...
 
float CoLo
 computed map center latitude (degree) More...
 
float CoLa
 computed map center longitude (degree) More...
 
STRING Path
 path in TVT tree store More...
 
STRING Desc
 desciption More...
 
UBYTE_PTR Buff
 buffer for input, and (later) points array More...
 

Detailed Description

UDT collecting and holding the track data.

This class (UDT) is designed to load track data from files and store the track points in memory. Currently it supports *.NMEA and *.GPX file formats, but can get easily extended for further formats in future (see NMEA and GPX classes).

It's a grounded class, designed to hold one instance per track in memory.

Since
0.0

Definition at line 59 of file track_loader.bi.

Constructor & Destructor Documentation

◆ TrackLoader()

TrackLoader::TrackLoader ( BYVAL_AS_CONST_ZSTRING_PTR  Fnam)

CTOR loading track data.

Parameters
FnamPathName of the file to operate on

This constructor opens an input file and greps track data. The file contents gets send to a parser, in order to get transformed from ASCII to binary data.

In case of an error the member variable TrackLoader.Errr ist set to an uman readable error message. The instance does not contain any usful data and should get DELETEd in this case.

Since
0.0

Definition at line 144 of file track_loader.bas.

◆ ~TrackLoader()

TrackLoader::~TrackLoader ( )

Definition at line 198 of file track_loader.bas.

Member Function Documentation

◆ Dist()

FUNCTION_AS_DOUBLE TrackLoader::Dist ( BYVAL_AS_ULONG  P0,
BYVAL_AS_ULONG  P1 
)

Compute distance between two points.

Parameters
P0The first index in array TrackLoader.V()
P1The second index in array TrackLoader.V()
Returns
The distance between both points in meters

After track points were graped from file, this function computes the distance between two points, given by the index in array TrackLoader.V.

Since
0.0

Definition at line 306 of file track_loader.bas.

◆ LTrk()

PROPERTY_AS_float TrackLoader::LTrk ( )

Compute track length.

Returns
The summ of the distances between the track points [m]

Property returning the overall track length. All three dimentional (incl. elevation) point distances get added.

If there is no distance (less than two points), NaN gets returned.

Since
0.0

Definition at line 287 of file track_loader.bas.

◆ ASpd()

PROPERTY_AS_float TrackLoader::ASpd ( )

Compute the speed avarage.

Returns
The avarage speed

The property evaluates the avarage speed by adding all speed meansurements and dividing by the number of entries.

Since
0.0

Definition at line 269 of file track_loader.bas.

◆ Pixel()

FUNCTION_AS_BYTE TrackLoader::Pixel ( BYVAL_AS_LONG  X,
BYVAL_AS_LONG  Y,
BYVAL_AS_LONG  Z 
)

Compute pixel values for given center and zoom.

Parameters
Xparents max-x property
Yparents max-y property
Zparents zoom property
Returns
0 (zero) on success, 1 in case of an error

FIXME

Since
0.0

Definition at line 213 of file track_loader.bas.

◆ SkipOut()

FUNCTION_AS_LONG TrackLoader::SkipOut ( BYVAL_AS_LONG  Typ,
BYVAL_AS_float  Di 
)

Compute exit of cloud.

Parameters
TypType of skipping
DiDistance to skip in [m]
Returns
The next track point out of a certain radius

The property evaluates the avarage speed by adding all speed meansurements and dividing by the number of entries.

Since
0.0

Definition at line 245 of file track_loader.bas.

◆ MapCenter()

SUB TrackLoader::MapCenter ( BYVAL_AS_LONG  W,
BYVAL_AS_LONG  H 
)

Compute center and zoom to plot complete track.

Parameters
WWidth of map
HHeight of map

Evaluates user settings (from minimum and maximum longitude and latitute) for the track center and the zoom level in order to plot the complete track in the map widget.

Since
0.0

Definition at line 348 of file track_loader.bas.

◆ Nearest()

FUNCTION_AS_float TrackLoader::Nearest ( BYVAL_AS_float  Lon,
BYVAL_AS_float  Lat 
)

Find point nearest to the given [radians] position.

Parameters
Lonpositions latitude
Latpositions longitude
Returns
Distance (2D in [radians])

Function to search the track points for the smallest distance to a given position, input and output in radians. Elevation gets not considered.

Since
0.0

Definition at line 328 of file track_loader.bas.

Member Data Documentation

◆ Errr

ZSTRING_PTR TrackLoader::Errr

error message

Definition at line 61 of file track_loader.bi.

◆ V

TrP_PTR TrackLoader::V

array of data

Definition at line 63 of file track_loader.bi.

◆ Mx

TrP TrackLoader::Mx

maximum values

Definition at line 65 of file track_loader.bi.

◆ Mn

TrP TrackLoader::Mn

minimum values

Definition at line 66 of file track_loader.bi.

◆ Byt

INTEGER TrackLoader::Byt

bytes read from file (buffer length)

Definition at line 68 of file track_loader.bi.

◆ Siz

INTEGER TrackLoader::Siz = 0

byte size of TrackLoader.V array

Definition at line 69 of file track_loader.bi.

◆ Tmp

LONG TrackLoader::Tmp

temp counter

Definition at line 71 of file track_loader.bi.

◆ Cur

LONG TrackLoader::Cur

last track position in map plot

Definition at line 72 of file track_loader.bi.

◆ Az

LONG TrackLoader::Az = -1

number of entries in array TrackLoader.V

Definition at line 73 of file track_loader.bi.

◆ UsZo

LONG TrackLoader::UsZo =-1

users zoom level in map

Definition at line 74 of file track_loader.bi.

◆ CoZo

LONG TrackLoader::CoZo

computed zoom level in map

Definition at line 75 of file track_loader.bi.

◆ Co_X

LONG TrackLoader::Co_X

map-X for computed pixels

Definition at line 76 of file track_loader.bi.

◆ Co_Y

LONG TrackLoader::Co_Y

map-Y for computed pixels

Definition at line 77 of file track_loader.bi.

◆ UsLo

float TrackLoader::UsLo

users map center latitude (degree)

Definition at line 79 of file track_loader.bi.

◆ UsLa

float TrackLoader::UsLa

users map center longitude (degree)

Definition at line 80 of file track_loader.bi.

◆ CoLo

float TrackLoader::CoLo

computed map center latitude (degree)

Definition at line 81 of file track_loader.bi.

◆ CoLa

float TrackLoader::CoLa

computed map center longitude (degree)

Definition at line 82 of file track_loader.bi.

◆ Path

STRING TrackLoader::Path

path in TVT tree store

Definition at line 84 of file track_loader.bi.

◆ Desc

STRING TrackLoader::Desc

desciption

Definition at line 85 of file track_loader.bi.

◆ Buff

UBYTE_PTR TrackLoader::Buff

buffer for input, and (later) points array

Definition at line 87 of file track_loader.bi.


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