mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 17:55:45 +08:00
Ref T472, category support in web data reader
This commit is contained in:
committed by
Mat Sutcliffe
parent
13b9179472
commit
716cd67a2c
@@ -285,9 +285,9 @@ namespace BlackCore
|
|||||||
|
|
||||||
if (m_icaoDataReader)
|
if (m_icaoDataReader)
|
||||||
{
|
{
|
||||||
if (whatToRead.testFlag(CEntityFlags::AircraftIcaoEntity) || whatToRead.testFlag(CEntityFlags::AirlineIcaoEntity) || whatToRead.testFlag(CEntityFlags::CountryEntity))
|
if (whatToRead.testFlag(CEntityFlags::AircraftIcaoEntity) || whatToRead.testFlag(CEntityFlags::AircraftCategoryEntity) || whatToRead.testFlag(CEntityFlags::AirlineIcaoEntity) || whatToRead.testFlag(CEntityFlags::CountryEntity))
|
||||||
{
|
{
|
||||||
CEntityFlags::Entity icaoEntities = whatToRead & CEntityFlags::AllIcaoAndCountries;
|
CEntityFlags::Entity icaoEntities = whatToRead & CEntityFlags::AllIcaoCountriesCategory;
|
||||||
m_icaoDataReader->readInBackgroundThread(icaoEntities, newerThan);
|
m_icaoDataReader->readInBackgroundThread(icaoEntities, newerThan);
|
||||||
triggeredRead |= icaoEntities;
|
triggeredRead |= icaoEntities;
|
||||||
}
|
}
|
||||||
@@ -699,6 +699,18 @@ namespace BlackCore
|
|||||||
return CAircraftIcaoCodeList();
|
return CAircraftIcaoCodeList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAircraftCategoryList CWebDataServices::getAircraftCategories() const
|
||||||
|
{
|
||||||
|
if (m_icaoDataReader) { return m_icaoDataReader->getAircraftCategories(); }
|
||||||
|
return CAircraftCategoryList();
|
||||||
|
}
|
||||||
|
|
||||||
|
int CWebDataServices::getAircraftCategoriesCount() const
|
||||||
|
{
|
||||||
|
if (m_icaoDataReader) { return m_icaoDataReader->getAircraftCategoryCount(); }
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool CWebDataServices::containsAircraftIcaoDesignator(const QString &designator) const
|
bool CWebDataServices::containsAircraftIcaoDesignator(const QString &designator) const
|
||||||
{
|
{
|
||||||
if (designator.isEmpty()) { return false; }
|
if (designator.isEmpty()) { return false; }
|
||||||
|
|||||||
@@ -262,6 +262,14 @@ namespace BlackCore
|
|||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
BlackMisc::Aviation::CAircraftIcaoCodeList getAircraftIcaoCodesForAirline(const BlackMisc::Aviation::CAirlineIcaoCode &airline) const;
|
BlackMisc::Aviation::CAircraftIcaoCodeList getAircraftIcaoCodesForAirline(const BlackMisc::Aviation::CAirlineIcaoCode &airline) const;
|
||||||
|
|
||||||
|
//! Aircraft categories
|
||||||
|
//! \threadsafe
|
||||||
|
BlackMisc::Aviation::CAircraftCategoryList getAircraftCategories() const;
|
||||||
|
|
||||||
|
//! Aircraft categories count
|
||||||
|
//! \threadsafe
|
||||||
|
int getAircraftCategoriesCount() const;
|
||||||
|
|
||||||
//! Contains the given designator?
|
//! Contains the given designator?
|
||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
bool containsAircraftIcaoDesignator(const QString &designator) const;
|
bool containsAircraftIcaoDesignator(const QString &designator) const;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace BlackCore
|
|||||||
CEntityFlags::Entity CWebReaderFlags::allEntitiesForReaders(WebReader readers)
|
CEntityFlags::Entity CWebReaderFlags::allEntitiesForReaders(WebReader readers)
|
||||||
{
|
{
|
||||||
CEntityFlags::Entity entities = CEntityFlags::NoEntity;
|
CEntityFlags::Entity entities = CEntityFlags::NoEntity;
|
||||||
if (readers.testFlag(IcaoDataReader)) { entities |= CEntityFlags::AllIcaoAndCountries; }
|
if (readers.testFlag(IcaoDataReader)) { entities |= CEntityFlags::AllIcaoCountriesCategory; }
|
||||||
if (readers.testFlag(ModelReader)) { entities |= CEntityFlags::DistributorLiveryModel; }
|
if (readers.testFlag(ModelReader)) { entities |= CEntityFlags::DistributorLiveryModel; }
|
||||||
if (readers.testFlag(AirportReader)) { entities |= CEntityFlags::AirportEntity; }
|
if (readers.testFlag(AirportReader)) { entities |= CEntityFlags::AirportEntity; }
|
||||||
if (readers.testFlag(DbInfoDataReader)) { entities |= CEntityFlags::DbInfoObjectEntity; }
|
if (readers.testFlag(DbInfoDataReader)) { entities |= CEntityFlags::DbInfoObjectEntity; }
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ namespace BlackCore
|
|||||||
AirportReader = 1 << 6, //!< reader for airport list
|
AirportReader = 1 << 6, //!< reader for airport list
|
||||||
DbInfoDataReader = 1 << 7, //!< DB info data (metdata, how many data, when updated)
|
DbInfoDataReader = 1 << 7, //!< DB info data (metdata, how many data, when updated)
|
||||||
AllVatsimReaders = VatsimBookingReader | VatsimDataReader | VatsimMetarReader | VatsimStatusReader, //!< all VATSIM readers
|
AllVatsimReaders = VatsimBookingReader | VatsimDataReader | VatsimMetarReader | VatsimStatusReader, //!< all VATSIM readers
|
||||||
AllSwiftDbReaders = IcaoDataReader | ModelReader | DbInfoDataReader | AirportReader, //!< all swift data
|
AllSwiftDbReaders = IcaoDataReader | ModelReader | DbInfoDataReader | AirportReader, //!< all swift data
|
||||||
AllReaders = AllSwiftDbReaders | AllVatsimReaders //!< everything
|
AllReaders = AllSwiftDbReaders | AllVatsimReaders //!< everything
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(WebReader, WebReaderFlag)
|
Q_DECLARE_FLAGS(WebReader, WebReaderFlag)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user