mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
Ref T111, added utility functions used for swift plugin (dummy driver)
* new reader functions * plugin info
This commit is contained in:
committed by
Mathew Sutcliffe
parent
29e1d54e05
commit
b1295cd457
@@ -34,6 +34,11 @@ namespace BlackCore
|
||||
return m_airportCache.get();
|
||||
}
|
||||
|
||||
CAirport CAirportDataReader::getAirportForIcaoDesignator(const QString &designator) const
|
||||
{
|
||||
return getAirports().findByIcao(CAirportIcaoCode(designator)).frontOrDefault();
|
||||
}
|
||||
|
||||
int CAirportDataReader::getAirportsCount() const
|
||||
{
|
||||
return this->getAirports().size();
|
||||
|
||||
@@ -38,6 +38,10 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CAirportList getAirports() const;
|
||||
|
||||
//! Returns airport for designator (or default)
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CAirport getAirportForIcaoDesignator(const QString &designator) const;
|
||||
|
||||
//! Returns a list of all airports in the database.
|
||||
//! \threadsafe
|
||||
int getAirportsCount() const;
|
||||
|
||||
@@ -523,9 +523,9 @@ namespace BlackCore
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QStringList CWebDataServices::getModelCompleterStrings(bool sorted) const
|
||||
QStringList CWebDataServices::getModelCompleterStrings(bool sorted, const CSimulatorInfo &simulator) const
|
||||
{
|
||||
if (m_modelDataReader) { return m_modelDataReader->getModels().toCompleterStrings(sorted); }
|
||||
if (m_modelDataReader) { return m_modelDataReader->getModels().toCompleterStrings(sorted, simulator); }
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
@@ -666,6 +666,12 @@ namespace BlackCore
|
||||
return 0;
|
||||
}
|
||||
|
||||
CAirport CWebDataServices::getAirportForIcaoDesignator(const QString &icao) const
|
||||
{
|
||||
if (m_airportDataReader) { return m_airportDataReader->getAirportForIcaoDesignator(icao); }
|
||||
return CAirport();
|
||||
}
|
||||
|
||||
CCountry CWebDataServices::getCountryForIsoCode(const QString &iso) const
|
||||
{
|
||||
if (m_icaoDataReader) { return m_icaoDataReader->getCountryForIsoCode(iso); }
|
||||
|
||||
@@ -223,7 +223,7 @@ namespace BlackCore
|
||||
|
||||
//! Model completer string
|
||||
//! \threadsafe
|
||||
QStringList getModelCompleterStrings(bool sorted = true) const;
|
||||
QStringList getModelCompleterStrings(bool sorted = true, const BlackMisc::Simulation::CSimulatorInfo &simulator = { BlackMisc::Simulation::CSimulatorInfo::All }) const;
|
||||
|
||||
//! Models for combined code and aircraft designator
|
||||
//! \threadsafe
|
||||
@@ -313,6 +313,10 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
int getAirportsCount() const;
|
||||
|
||||
//! Get airport for ICAO designator
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CAirport getAirportForIcaoDesignator(const QString &icao) const;
|
||||
|
||||
//! Get METARs
|
||||
//! \threadsafe
|
||||
BlackMisc::Weather::CMetarList getMetars() const;
|
||||
|
||||
Reference in New Issue
Block a user