Updraft
1.0
Open source glider flight visualisation tool.
|
A class that loads an IGC file. More...
#include <igc.h>
Public Types | |
typedef QList< Event const * > | EventList |
typedef QListIterator< Event const * > | EventListIterator |
Public Member Functions | |
~IgcFile () | |
bool | load (const QString &path, QTextCodec *codec=0) |
Open a file with given path and load it. | |
bool | load (QIODevice *file, QTextCodec *codec=0) |
Load a file from opened QIODevice. | |
void | clear () |
Delete all loaded data. | |
qreal | altimeterSetting () const |
Return altimeter pressure setting in hectopascals or zero if it was not specified. | |
QString | competitionClass () const |
Return competition class or null string. | |
QString | competitionId () const |
Return glider competition ID or null string. | |
QDate | date () const |
Return date of the recording. | |
QString | manufacturer () const |
Return FR manufacturer or null string. | |
QString | frType () const |
Return FR type or null string. | |
QString | gliderId () const |
Return glider registration number or null string. | |
QString | gps () const |
Return GPS receiver type or null string. | |
QString | gliderType () const |
Return glider model or null string. | |
QString | pilot () const |
Return pilot name or null string. | |
const EventList & | events () const |
Return a const reference to the event map. | |
Private Member Functions | |
bool | loadOneRecord () |
Load record into the buffer and parse it. | |
bool | parseOneRecord () |
Parse a single record stored in the buffer. | |
QTime | parseTimestamp (QByteArray bytes, bool *ok) |
Parse time from IGC encoding. | |
qreal | parseLatLon (QByteArray bytes, bool *ok) |
Parse latitude or longitude from IGC encoding. | |
qreal | parseDecimal (QByteArray bytes, bool *ok) |
Parse a decimal number in igc format. | |
QDate | parseDate (QByteArray bytes, bool *ok) |
Parse date specification. | |
bool | processRecordB () |
Process a single record of type B (fix data) stored in buffer. | |
bool | processRecordH () |
Process a single record of type H (headers) stored in buffer. | |
bool | processRecordL () |
Process a single record of type L (comments) stored in buffer. | |
Static Private Member Functions | |
static bool | eventLessThan (Event const *e1, Event const *e2) |
Comparator function for sorting events in the list according to timestamp. | |
Private Attributes | |
EventList | eventList |
QByteArray | buffer |
char | previousRecord |
QIODevice * | file |
QTextCodec * | activeCodec |
qreal | altimeterSetting_ |
Data extracted from IGC headers. | |
QString | competitionClass_ |
QString | competitionId_ |
QDate | date_ |
QString | manufacturer_ |
QString | frType_ |
QString | gliderId_ |
QString | gps_ |
QString | gliderType_ |
QString | pilot_ |
A class that loads an IGC file.
typedef QList<Event const*> Updraft::Igc::IgcFile::EventList |
typedef QListIterator<Event const*> Updraft::Igc::IgcFile::EventListIterator |
Updraft::Igc::IgcFile::~IgcFile | ( | ) | [inline] |
qreal Updraft::Igc::IgcFile::altimeterSetting | ( | ) | const [inline] |
Return altimeter pressure setting in hectopascals or zero if it was not specified.
This value doesn't affect altitudes returned in fixes in any way. All recorded altitudes use 1013.25 as a base pressure.
void Updraft::Igc::IgcFile::clear | ( | ) |
Delete all loaded data.
QString Updraft::Igc::IgcFile::competitionClass | ( | ) | const [inline] |
Return competition class or null string.
QString Updraft::Igc::IgcFile::competitionId | ( | ) | const [inline] |
Return glider competition ID or null string.
QDate Updraft::Igc::IgcFile::date | ( | ) | const [inline] |
Return date of the recording.
bool Updraft::Igc::IgcFile::eventLessThan | ( | Event const * | e1, |
Event const * | e2 | ||
) | [static, private] |
Comparator function for sorting events in the list according to timestamp.
const EventList& Updraft::Igc::IgcFile::events | ( | ) | const [inline] |
Return a const reference to the event map.
QString Updraft::Igc::IgcFile::frType | ( | ) | const [inline] |
Return FR type or null string.
QString Updraft::Igc::IgcFile::gliderId | ( | ) | const [inline] |
Return glider registration number or null string.
QString Updraft::Igc::IgcFile::gliderType | ( | ) | const [inline] |
Return glider model or null string.
QString Updraft::Igc::IgcFile::gps | ( | ) | const [inline] |
Return GPS receiver type or null string.
bool Updraft::Igc::IgcFile::load | ( | const QString & | path, |
QTextCodec * | codec = 0 |
||
) |
Open a file with given path and load it.
bool Updraft::Igc::IgcFile::load | ( | QIODevice * | file, |
QTextCodec * | codec = 0 |
||
) |
Load a file from opened QIODevice.
bool Updraft::Igc::IgcFile::loadOneRecord | ( | ) | [private] |
Load record into the buffer and parse it.
QString Updraft::Igc::IgcFile::manufacturer | ( | ) | const [inline] |
Return FR manufacturer or null string.
QDate Updraft::Igc::IgcFile::parseDate | ( | QByteArray | bytes, |
bool * | ok | ||
) | [private] |
Parse date specification.
bytes | The byte array with the date to be parsed. |
ok | Set to true if parsing was successful, false otherwise. |
qreal Updraft::Igc::IgcFile::parseDecimal | ( | QByteArray | bytes, |
bool * | ok | ||
) | [private] |
Parse a decimal number in igc format.
bytes | The byte array with the decimal number to be parsed. |
ok | Set to true if parsing was successful, false otherwise. |
qreal Updraft::Igc::IgcFile::parseLatLon | ( | QByteArray | bytes, |
bool * | ok | ||
) | [private] |
Parse latitude or longitude from IGC encoding.
bytes | The byte array with the latitude/longitude number to be parsed. |
ok | Set to true if parsing was successful, false otherwise. |
bool Updraft::Igc::IgcFile::parseOneRecord | ( | ) | [private] |
Parse a single record stored in the buffer.
QTime Updraft::Igc::IgcFile::parseTimestamp | ( | QByteArray | bytes, |
bool * | ok | ||
) | [private] |
Parse time from IGC encoding.
The time is in the HHMMSS format.
bytes | The byte array with the time to be parsed. |
ok | Set to true if parsing was successful, false otherwise. |
QString Updraft::Igc::IgcFile::pilot | ( | ) | const [inline] |
Return pilot name or null string.
bool Updraft::Igc::IgcFile::processRecordB | ( | ) | [private] |
Process a single record of type B (fix data) stored in buffer.
bool Updraft::Igc::IgcFile::processRecordH | ( | ) | [private] |
Process a single record of type H (headers) stored in buffer.
bool Updraft::Igc::IgcFile::processRecordL | ( | ) | [private] |
Process a single record of type L (comments) stored in buffer.
QTextCodec* Updraft::Igc::IgcFile::activeCodec [private] |
qreal Updraft::Igc::IgcFile::altimeterSetting_ [private] |
Data extracted from IGC headers.
QByteArray Updraft::Igc::IgcFile::buffer [private] |
QString Updraft::Igc::IgcFile::competitionClass_ [private] |
QString Updraft::Igc::IgcFile::competitionId_ [private] |
QDate Updraft::Igc::IgcFile::date_ [private] |
EventList Updraft::Igc::IgcFile::eventList [private] |
QIODevice* Updraft::Igc::IgcFile::file [private] |
QString Updraft::Igc::IgcFile::frType_ [private] |
QString Updraft::Igc::IgcFile::gliderId_ [private] |
QString Updraft::Igc::IgcFile::gliderType_ [private] |
QString Updraft::Igc::IgcFile::gps_ [private] |
QString Updraft::Igc::IgcFile::manufacturer_ [private] |
QString Updraft::Igc::IgcFile::pilot_ [private] |
char Updraft::Igc::IgcFile::previousRecord [private] |