mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
More detailed info about excluded models
This commit is contained in:
@@ -498,6 +498,8 @@ namespace BlackCore
|
||||
if ((r1 + r2) > 0)
|
||||
{
|
||||
CLogMessage(this).warning("Removed models for matcher, without string '%1', excluded '%2'") << r1 << r2;
|
||||
if (r1 > 0) { CLogMessage(this).warning("Without string: %1") << models.findEmptyModelStrings().getModelStringList().join(", "); }
|
||||
if (r2 > 0) { CLogMessage(this).warning("Excluded: %1") << models.findByModelMode(CAircraftModel::Exclude).getModelStringList().join(", "); }
|
||||
}
|
||||
if (modelsCleaned.isEmpty())
|
||||
{
|
||||
|
||||
@@ -96,6 +96,14 @@ namespace BlackMisc
|
||||
});
|
||||
}
|
||||
|
||||
CAircraftModelList CAircraftModelList::findEmptyModelStrings() const
|
||||
{
|
||||
return this->findBy([ & ](const CAircraftModel & model)
|
||||
{
|
||||
return !model.hasModelString();
|
||||
});
|
||||
}
|
||||
|
||||
CAircraftModel CAircraftModelList::findFirstByModelStringOrDefault(const QString &modelString, Qt::CaseSensitivity sensitivity) const
|
||||
{
|
||||
if (modelString.isEmpty()) { return CAircraftModel(); }
|
||||
@@ -297,6 +305,14 @@ namespace BlackMisc
|
||||
});
|
||||
}
|
||||
|
||||
CAircraftModelList CAircraftModelList::findByModelMode(CAircraftModel::ModelMode mode) const
|
||||
{
|
||||
return this->findBy([ = ](const CAircraftModel & model)
|
||||
{
|
||||
return (model.getModelMode() == mode);
|
||||
});
|
||||
}
|
||||
|
||||
CAircraftModelList CAircraftModelList::getAllFsFamilyModels() const
|
||||
{
|
||||
return this->findBy([](const CAircraftModel & model)
|
||||
|
||||
@@ -104,6 +104,9 @@ namespace BlackMisc
|
||||
//! \remark normally CAircraftModelList::findFirstByModelStringOrDefault would be used
|
||||
CAircraftModelList findByModelString(const QString &modelString, Qt::CaseSensitivity sensitivity = Qt::CaseInsensitive) const;
|
||||
|
||||
//! Find empty model strings
|
||||
CAircraftModelList findEmptyModelStrings() const;
|
||||
|
||||
//! Find first by model string
|
||||
CAircraftModel findFirstByModelStringOrDefault(const QString &modelString, Qt::CaseSensitivity sensitivity = Qt::CaseInsensitive) const;
|
||||
|
||||
@@ -176,6 +179,9 @@ namespace BlackMisc
|
||||
//! Find by VTOL flag, \c false returns non VTOL models
|
||||
CAircraftModelList findByVtolFlag(bool vtol) const;
|
||||
|
||||
//! Find by model mode
|
||||
CAircraftModelList findByModelMode(CAircraftModel::ModelMode mode) const;
|
||||
|
||||
//! Model icon path
|
||||
QString findModelIconPathByModelString(const QString &modelString) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user