mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 05:28:09 +08:00
refs #720, improved distributor and airline/livery detection
* mark data read from DB (req. for string key where existing key value is not reliable indicator for DB data) * detect distributors by part of model string * use a simplified name (no spaces, no special characters) to find a match * allow to obtain model strings (=keys) as set and list
This commit is contained in:
committed by
Mathew Sutcliffe
parent
39dae7ed45
commit
f9922353c4
@@ -18,7 +18,6 @@
|
||||
#include "blackmisc/orderablelist.h"
|
||||
#include "blackmisc/sequence.h"
|
||||
#include "blackmisc/simulation/distributor.h"
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
#include <QMetaType>
|
||||
@@ -29,6 +28,8 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
class CSimulatorModel;
|
||||
|
||||
//! Value object encapsulating a list of distributors.
|
||||
class BLACKMISC_EXPORT CDistributorList :
|
||||
public BlackMisc::CSequence<CDistributor>,
|
||||
@@ -48,9 +49,16 @@ namespace BlackMisc
|
||||
//! Find by id or alias
|
||||
CDistributor findByKeyOrAlias(const QString &keyOrAlias) const;
|
||||
|
||||
//! Find by model string
|
||||
//! \remark model strings may have a pattern which makes it impossible to find the distributor
|
||||
CDistributor findByModelData(const CAircraftModel &model) const;
|
||||
|
||||
//! Best match by given pattern
|
||||
CDistributor smartDistributorSelector(const CDistributor &distributorPattern) const;
|
||||
|
||||
//! Best match by given pattern
|
||||
CDistributor smartDistributorSelector(const CDistributor &distributorPattern, const CAircraftModel &model) const;
|
||||
|
||||
//! At least is matching key or alias
|
||||
bool matchesAnyKeyOrAlias(const QString &keyOrAlias) const;
|
||||
|
||||
@@ -58,7 +66,7 @@ namespace BlackMisc
|
||||
QStringList getDbKeysAndAliases(bool sort) const;
|
||||
|
||||
//! Find for given simulator
|
||||
CDistributorList matchesSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator) const;
|
||||
CDistributorList matchesSimulator(const CSimulatorInfo &simulator) const;
|
||||
};
|
||||
} //namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user