Updraft  1.0
Open source glider flight visualisation tool.
Updraft::Igc::IgcFile Class Reference

A class that loads an IGC file. More...

#include <igc.h>

List of all members.

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 EventListevents () 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_

Detailed Description

A class that loads an IGC file.


Member Typedef Documentation

typedef QList<Event const*> Updraft::Igc::IgcFile::EventList
typedef QListIterator<Event const*> Updraft::Igc::IgcFile::EventListIterator

Constructor & Destructor Documentation


Member Function Documentation

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.

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.

Load record into the buffer and parse it.

Returns:
True on success.
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.

Parameters:
bytesThe byte array with the date to be parsed.
okSet 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.

Parameters:
bytesThe byte array with the decimal number to be parsed.
okSet 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.

Parameters:
bytesThe byte array with the latitude/longitude number to be parsed.
okSet to true if parsing was successful, false otherwise.
Returns:
Degrees. Negative values go south and west. DDMMmmm[NS] or DDDMMmmm[EW]

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.

Parameters:
bytesThe byte array with the time to be parsed.
okSet to true if parsing was successful, false otherwise.
QString Updraft::Igc::IgcFile::pilot ( ) const [inline]

Return pilot name or null string.

Process a single record of type B (fix data) stored in buffer.

Process a single record of type H (headers) stored in buffer.

Process a single record of type L (comments) stored in buffer.


Member Data Documentation

QTextCodec* Updraft::Igc::IgcFile::activeCodec [private]

Data extracted from IGC headers.

QByteArray Updraft::Igc::IgcFile::buffer [private]
QIODevice* Updraft::Igc::IgcFile::file [private]
QString Updraft::Igc::IgcFile::frType_ [private]
QString Updraft::Igc::IgcFile::gps_ [private]
QString Updraft::Igc::IgcFile::pilot_ [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines