|
Enroute Flight Navigation
A navigation app for VFR pilots
|
Library of visual approach charts. More...
#include <VACLibrary.h>
Public Types | |
| enum | Role : int { VacRole = Qt::UserRole + 1 , NameRole , SectionRole , CenterRole } |
| Model roles. More... | |
Signals | |
| void | hasManuallyImportedChanged () |
| Notifier signal. | |
| void | isEmptyChanged () |
| Notifier signal. | |
| void | vacsChanged () |
| 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. | |
| QBindable< bool > | bindableHasManuallyImported () const |
| Getter function for property of the same name. | |
| bool | isEmpty () const |
| Getter function for property of the same name. | |
| QBindable< bool > | bindableIsEmpty () const |
| Getter function for property of the same name. | |
| QList< GeoMaps::VAC > | vacs () const |
| Getter function for property of the same name. | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Re-implemented from QAbstractListModel. | |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Re-implemented from QAbstractListModel. | |
| QHash< int, QByteArray > | roleNames () const override |
| Re-implemented from QAbstractListModel. | |
| 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::VAC > | vacs4Point (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::VAC > | vacs |
| List of all VACs installed. | |
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().
The library is a list model with one row per chart, sorted by section and name, and with the roles 'vac', 'name', 'section' and 'center'. Changes are announced with row-granular model signals, and with the coarse signal vacsChanged() for consumers of the property 'vacs'. In QML, bind a view to this singleton through a NameFilterProxyModel or a DistanceSortProxyModel.
Definition at line 54 of file VACLibrary.h.
| enum GeoMaps::VACLibrary::Role : int |
Model roles.
| Enumerator | |
|---|---|
| VacRole | The chart, of type GeoMaps::VAC. |
| NameRole | Name of the chart, a QString. |
| SectionRole | Section of the chart, a QString; see GeoMaps::VAC::section(). |
| CenterRole | Center of the chart, a QGeoCoordinate. |
Definition at line 71 of file VACLibrary.h.
| GeoMaps::VACLibrary::VACLibrary | ( | QObject * | parent = nullptr | ) |
Constructor.
| parent | Standard QObject parent |
|
inlinenodiscard |
Getter function for property of the same name.
Definition at line 117 of file VACLibrary.h.
|
inlinenodiscard |
Getter function for property of the same name.
Definition at line 129 of file VACLibrary.h.
| Q_INVOKABLE void GeoMaps::VACLibrary::clear | ( | ) |
Removes all VACs.
This method also deletes the associated files.
|
nodiscardoverride |
Re-implemented from QAbstractListModel.
| index | Model index |
| role | One of the roles in VACLibrary::Role |
|
nodiscard |
|
inlinenodiscard |
Getter function for property of the same name.
Definition at line 111 of file VACLibrary.h.
|
nodiscard |
Import trip kit.
| fileName | Name of the trip kit file |
|
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.
| percent | A number between 0.0 and 1.0. |
|
nodiscard |
|
inlinenodiscard |
Getter function for property of the same name.
Definition at line 123 of file VACLibrary.h.
|
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.
| vac | VAC to materialize |
| Q_INVOKABLE void GeoMaps::VACLibrary::remove | ( | const QString & | name | ) |
|
nodiscard |
|
nodiscardoverride |
Re-implemented from QAbstractListModel.
|
nodiscardoverride |
Re-implemented from QAbstractListModel.
| parent | Parent index, invalid for the list itself |
|
inlinenodiscard |
Getter function for property of the same name.
Definition at line 135 of file VACLibrary.h.
|
nodiscard |
List of all VACs that contain a given point.
This method returns the list of all installed VACs that contain the given point.
| position | Geographic position |
|
read |
List of all VACs installed.
This property holds the list of all installed VACs, in model order: sorted by section, then by name.
Definition at line 100 of file VACLibrary.h.