mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Ref T509, utility function for ICAO codes
This commit is contained in:
committed by
Mat Sutcliffe
parent
80a36f4346
commit
20b83d66eb
@@ -406,6 +406,24 @@ namespace BlackMisc
|
|||||||
return distributors;
|
return distributors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QMap<CAircraftIcaoCode, int> CAircraftModelList::countPerAircraftIcao() const
|
||||||
|
{
|
||||||
|
QMap<CAircraftIcaoCode, int> icaos;
|
||||||
|
for (const CAircraftModel &model : *this)
|
||||||
|
{
|
||||||
|
if (!model.hasAircraftDesignator()) { continue; }
|
||||||
|
if (icaos.contains(model.getAircraftIcaoCode()))
|
||||||
|
{
|
||||||
|
icaos[model.getAircraftIcaoCode()]++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
icaos[model.getAircraftIcaoCode()] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return icaos;
|
||||||
|
}
|
||||||
|
|
||||||
QString CAircraftModelList::findModelIconPathByModelString(const QString &modelString) const
|
QString CAircraftModelList::findModelIconPathByModelString(const QString &modelString) const
|
||||||
{
|
{
|
||||||
if (modelString.isEmpty()) { return {}; }
|
if (modelString.isEmpty()) { return {}; }
|
||||||
|
|||||||
@@ -299,9 +299,12 @@ namespace BlackMisc
|
|||||||
//! Model strings plus count
|
//! Model strings plus count
|
||||||
QMap<QString, int> countPerModelString() const;
|
QMap<QString, int> countPerModelString() const;
|
||||||
|
|
||||||
//! Distributor plus count
|
//! Distributors plus count
|
||||||
QMap<BlackMisc::Simulation::CDistributor, int> countPerDistributor() const;
|
QMap<BlackMisc::Simulation::CDistributor, int> countPerDistributor() const;
|
||||||
|
|
||||||
|
//! Aircraft ICAO plus count
|
||||||
|
QMap<BlackMisc::Aviation::CAircraftIcaoCode, int> countPerAircraftIcao() const;
|
||||||
|
|
||||||
//! Which simulator(s) have the most entries?
|
//! Which simulator(s) have the most entries?
|
||||||
CSimulatorInfo simulatorsWithMaxEntries() const;
|
CSimulatorInfo simulatorsWithMaxEntries() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user