UDT collecting and holding the track data. More...
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... | |
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.
Definition at line 59 of file track_loader.bi.
TrackLoader::TrackLoader | ( | BYVAL_AS_CONST_ZSTRING_PTR | Fnam | ) |
CTOR loading track data.
Fnam | PathName 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.
Definition at line 144 of file track_loader.bas.
TrackLoader::~TrackLoader | ( | ) |
Definition at line 198 of file track_loader.bas.
FUNCTION_AS_DOUBLE TrackLoader::Dist | ( | BYVAL_AS_ULONG | P0, |
BYVAL_AS_ULONG | P1 | ||
) |
Compute distance between two points.
P0 | The first index in array TrackLoader.V() |
P1 | The second index in array TrackLoader.V() |
After track points were graped from file, this function computes the distance between two points, given by the index in array TrackLoader.V.
Definition at line 306 of file track_loader.bas.
PROPERTY_AS_float TrackLoader::LTrk | ( | ) |
Compute track length.
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.
Definition at line 287 of file track_loader.bas.
PROPERTY_AS_float TrackLoader::ASpd | ( | ) |
Compute the speed avarage.
The property evaluates the avarage speed by adding all speed meansurements and dividing by the number of entries.
Definition at line 269 of file track_loader.bas.
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.
X | parents max-x property |
Y | parents max-y property |
Z | parents zoom property |
FIXME
Definition at line 213 of file track_loader.bas.
FUNCTION_AS_LONG TrackLoader::SkipOut | ( | BYVAL_AS_LONG | Typ, |
BYVAL_AS_float | Di | ||
) |
Compute exit of cloud.
Typ | Type of skipping |
Di | Distance to skip in [m] |
The property evaluates the avarage speed by adding all speed meansurements and dividing by the number of entries.
Definition at line 245 of file track_loader.bas.
SUB TrackLoader::MapCenter | ( | BYVAL_AS_LONG | W, |
BYVAL_AS_LONG | H | ||
) |
Compute center and zoom to plot complete track.
W | Width of map |
H | Height 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.
Definition at line 348 of file track_loader.bas.
FUNCTION_AS_float TrackLoader::Nearest | ( | BYVAL_AS_float | Lon, |
BYVAL_AS_float | Lat | ||
) |
Find point nearest to the given [radians] position.
Lon | positions latitude |
Lat | positions longitude |
Function to search the track points for the smallest distance to a given position, input and output in radians. Elevation gets not considered.
Definition at line 328 of file track_loader.bas.
ZSTRING_PTR TrackLoader::Errr |
error message
Definition at line 61 of file track_loader.bi.
TrP_PTR TrackLoader::V |
array of data
Definition at line 63 of file track_loader.bi.
TrP TrackLoader::Mx |
maximum values
Definition at line 65 of file track_loader.bi.
TrP TrackLoader::Mn |
minimum values
Definition at line 66 of file track_loader.bi.
INTEGER TrackLoader::Byt |
bytes read from file (buffer length)
Definition at line 68 of file track_loader.bi.
INTEGER TrackLoader::Siz = 0 |
byte size of TrackLoader.V array
Definition at line 69 of file track_loader.bi.
LONG TrackLoader::Tmp |
temp counter
Definition at line 71 of file track_loader.bi.
LONG TrackLoader::Cur |
last track position in map plot
Definition at line 72 of file track_loader.bi.
LONG TrackLoader::Az = -1 |
number of entries in array TrackLoader.V
Definition at line 73 of file track_loader.bi.
LONG TrackLoader::UsZo =-1 |
users zoom level in map
Definition at line 74 of file track_loader.bi.
LONG TrackLoader::CoZo |
computed zoom level in map
Definition at line 75 of file track_loader.bi.
LONG TrackLoader::Co_X |
map-X for computed pixels
Definition at line 76 of file track_loader.bi.
LONG TrackLoader::Co_Y |
map-Y for computed pixels
Definition at line 77 of file track_loader.bi.
float TrackLoader::UsLo |
users map center latitude (degree)
Definition at line 79 of file track_loader.bi.
float TrackLoader::UsLa |
users map center longitude (degree)
Definition at line 80 of file track_loader.bi.
float TrackLoader::CoLo |
computed map center latitude (degree)
Definition at line 81 of file track_loader.bi.
float TrackLoader::CoLa |
computed map center longitude (degree)
Definition at line 82 of file track_loader.bi.
STRING TrackLoader::Path |
path in TVT tree store
Definition at line 84 of file track_loader.bi.
STRING TrackLoader::Desc |
desciption
Definition at line 85 of file track_loader.bi.
UBYTE_PTR TrackLoader::Buff |
buffer for input, and (later) points array
Definition at line 87 of file track_loader.bi.