Enroute Flight Navigation
A navigation app for VFR pilots
GeoMaps::VACLibrary Class Reference

Library of visual approach charts. More...

#include <VACLibrary.h>

Signals

void dataChanged ()
 Notifier signal.
void importTripKitStatus (double percent)
 Progress report when importing a trip kit.

Public Member Functions

 VACLibrary (QObject *parent=nullptr)
 Constructor.
 ~VACLibrary () override
 Destructor.
bool hasManuallyImported () const
 Getter function for property of the same name.
bool isEmpty () const
 Getter function for property of the same name.
QList< GeoMaps::VACvacs ()
 Getter function for property of the same name.
Q_INVOKABLE void clear ()
 Removes all VACs.
Q_INVOKABLE GeoMaps::VAC get (const QString &name)
 Obtain VACs from the library.
Q_INVOKABLE QString importTripKit (const QString &fileName)
 Import trip kit.
Q_INVOKABLE GeoMaps::VAC materialize (const GeoMaps::VAC &vac)
 Obtain a VAC whose fileName points to a raster image file.
Q_INVOKABLE QString importVAC (GeoMaps::VAC vac)
 Import VAC.
Q_INVOKABLE void remove (const QString &name)
 Remove one VACs.
Q_INVOKABLE QString rename (const QString &oldName, const QString &newName)
 Rename a VACs.
Q_INVOKABLE QVector< GeoMaps::VACvacsByDistance (const QGeoCoordinate &position, const QString &filter)
 List of all VACs installed.
Q_INVOKABLE QVector< GeoMaps::VACvacs4Point (const QGeoCoordinate &position)
 List of all VACs that contain a given point.

Properties

bool hasManuallyImported
 True if the library contains manually imported charts.
bool isEmpty
 True if library is empty.
QList< GeoMaps::VACvacs
 List of all VACs installed.

Detailed Description

Library of visual approach charts.

This class collects visual approach charts that the user has installed. The list is automatically loaded on startup, and saved every time that a change is made.

In addition to manually imported charts, this class presents the charts contained in the VAC collections managed by DataManagement::DataManager. These charts are not stored in the library data file, cannot be renamed or removed individually, and their raster data is extracted on demand; see materialize().

Definition at line 46 of file VACLibrary.h.

Constructor & Destructor Documentation

◆ VACLibrary()

GeoMaps::VACLibrary::VACLibrary ( QObject * parent = nullptr)

Constructor.

Parameters
parentStandard QObject parent

Member Function Documentation

◆ clear()

Q_INVOKABLE void GeoMaps::VACLibrary::clear ( )

Removes all VACs.

This method also deletes the associated files.

◆ get()

Q_INVOKABLE GeoMaps::VAC GeoMaps::VACLibrary::get ( const QString & name)
nodiscard

Obtain VACs from the library.

Parameters
nameName of the VAC
Returns
Returns an invalid, default-constructed VAC if the name does not exist in the library.

◆ hasManuallyImported()

bool GeoMaps::VACLibrary::hasManuallyImported ( ) const
inlinenodiscard

Getter function for property of the same name.

Returns
Property hasManuallyImported

Definition at line 88 of file VACLibrary.h.

◆ importTripKit()

Q_INVOKABLE QString GeoMaps::VACLibrary::importTripKit ( const QString & fileName)
nodiscard

Import trip kit.

Parameters
fileNameName of the trip kit file
Returns
A localized error message, or an empty string on success

◆ importTripKitStatus

void GeoMaps::VACLibrary::importTripKitStatus ( double percent)
signal

Progress report when importing a trip kit.

This signal is emitted when TripKits are imported. At the end of the import, the precise value 1.0 is emitted.

Parameters
percentA number between 0.0 and 1.0.

◆ importVAC()

Q_INVOKABLE QString GeoMaps::VACLibrary::importVAC ( GeoMaps::VAC vac)
nodiscard

Import VAC.

This method copies the file 'fileName' to the library directory. It does not take ownership of the file, and does not delete the file.

Parameters
vacVAC to be imported
Returns
A localized error message, or an empty string on success

◆ isEmpty()

bool GeoMaps::VACLibrary::isEmpty ( ) const
inlinenodiscard

Getter function for property of the same name.

Returns
Property isEmpty

Definition at line 94 of file VACLibrary.h.

◆ materialize()

Q_INVOKABLE GeoMaps::VAC GeoMaps::VACLibrary::materialize ( const GeoMaps::VAC & vac)
nodiscard

Obtain a VAC whose fileName points to a raster image file.

Charts from VAC collections have their member 'fileName' set to the name of the collection file. This method extracts the raster image of such a chart to a cache directory and returns a copy of the VAC whose 'fileName' points to the extracted image, ready for display in the moving map. Manually imported charts are returned unchanged.

Parameters
vacVAC to materialize
Returns
A VAC whose fileName points to a raster image file, or the unchanged input on error.

◆ remove()

Q_INVOKABLE void GeoMaps::VACLibrary::remove ( const QString & name)

Remove one VACs.

Parameters
nameName of the VAC

This method also deletes the associated file.

◆ rename()

Q_INVOKABLE QString GeoMaps::VACLibrary::rename ( const QString & oldName,
const QString & newName )
nodiscard

Rename a VACs.

Parameters
oldNameName of the VAC to be removed
newNameNew name of the VAC
Returns
A localized error message, or an empty string on success

◆ vacs()

QList< GeoMaps::VAC > GeoMaps::VACLibrary::vacs ( )
nodiscard

Getter function for property of the same name.

Returns
Property vacs

◆ vacs4Point()

Q_INVOKABLE QVector< GeoMaps::VAC > GeoMaps::VACLibrary::vacs4Point ( const QGeoCoordinate & position)
nodiscard

List of all VACs that contain a given point.

This method returns the list of all installed VACs that contain the given point.

Parameters
positionGeographic position
Returns
List of all VACs containing the given point.

◆ vacsByDistance()

Q_INVOKABLE QVector< GeoMaps::VAC > GeoMaps::VACLibrary::vacsByDistance ( const QGeoCoordinate & position,
const QString & filter )
nodiscard

List of all VACs installed.

This method returns the list of all installed VACs, sorted by distance to position (closest waypoints first).

Parameters
positionGeographic position used for sorting
filterList of words
Returns
List of all VACs installed

Property Documentation

◆ vacs

QList<GeoMaps::VAC> GeoMaps::VACLibrary::vacs
read

List of all VACs installed.

This property holds the list of all installed VACs, sorted alphabetically by name.

Definition at line 77 of file VACLibrary.h.


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