mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +08:00
More detailled validation messages "which models look odd"
This commit is contained in:
committed by
Mat Sutcliffe
parent
decdbb4432
commit
507e059438
@@ -496,6 +496,13 @@ namespace BlackMisc
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAircraftModelList CAircraftModelList::findWithoutValidDbKey(int maxElements) const
|
||||||
|
{
|
||||||
|
CAircraftModelList ml = this->findWithoutValidDbKey();
|
||||||
|
ml.truncate(maxElements);
|
||||||
|
return ml;
|
||||||
|
}
|
||||||
|
|
||||||
CAircraftModelList CAircraftModelList::findNonDbModelsForAirline(const QString &airline) const
|
CAircraftModelList CAircraftModelList::findNonDbModelsForAirline(const QString &airline) const
|
||||||
{
|
{
|
||||||
const CAircraftModelList noDb = this->findWithoutValidDbKey();
|
const CAircraftModelList noDb = this->findWithoutValidDbKey();
|
||||||
@@ -523,7 +530,7 @@ namespace BlackMisc
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftModelList CAircraftModelList::getAllIncludedModels() const
|
CAircraftModelList CAircraftModelList::findAllIncludedModels() const
|
||||||
{
|
{
|
||||||
return this->findBy([](const CAircraftModel & model)
|
return this->findBy([](const CAircraftModel & model)
|
||||||
{
|
{
|
||||||
@@ -531,6 +538,28 @@ namespace BlackMisc
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAircraftModelList CAircraftModelList::findAllIncludedModels(int maxElements) const
|
||||||
|
{
|
||||||
|
CAircraftModelList ml = this->findAllIncludedModels();
|
||||||
|
ml.truncate(maxElements);
|
||||||
|
return ml;
|
||||||
|
}
|
||||||
|
|
||||||
|
CAircraftModelList CAircraftModelList::findAllExcludedModels() const
|
||||||
|
{
|
||||||
|
return this->findBy([](const CAircraftModel & model)
|
||||||
|
{
|
||||||
|
return model.getModelMode() == CAircraftModel::Exclude;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
CAircraftModelList CAircraftModelList::findAllExcludedModels(int maxElements) const
|
||||||
|
{
|
||||||
|
CAircraftModelList ml = this->findAllExcludedModels();
|
||||||
|
ml.truncate(maxElements);
|
||||||
|
return ml;
|
||||||
|
}
|
||||||
|
|
||||||
CAircraftModelList CAircraftModelList::findDuplicateModelStrings() const
|
CAircraftModelList CAircraftModelList::findDuplicateModelStrings() const
|
||||||
{
|
{
|
||||||
const QMap<QString, int> modelStrings = this->countPerModelString();
|
const QMap<QString, int> modelStrings = this->countPerModelString();
|
||||||
|
|||||||
@@ -266,6 +266,7 @@ namespace BlackMisc
|
|||||||
//! With/without DB key @{
|
//! With/without DB key @{
|
||||||
CAircraftModelList findWithValidDbKey() const;
|
CAircraftModelList findWithValidDbKey() const;
|
||||||
CAircraftModelList findWithoutValidDbKey() const;
|
CAircraftModelList findWithoutValidDbKey() const;
|
||||||
|
CAircraftModelList findWithoutValidDbKey(int maxElements) const;
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
//! Some finders for NON DB models, mostly for matching script results @{
|
//! Some finders for NON DB models, mostly for matching script results @{
|
||||||
@@ -274,8 +275,12 @@ namespace BlackMisc
|
|||||||
CAircraftModelList findNonDbModelsForModelString(const QString &modelString) const;
|
CAircraftModelList findNonDbModelsForModelString(const QString &modelString) const;
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
//! All included models
|
//! All included/excluded models @{
|
||||||
CAircraftModelList getAllIncludedModels() const;
|
CAircraftModelList findAllIncludedModels() const;
|
||||||
|
CAircraftModelList findAllIncludedModels(int maxElements) const;
|
||||||
|
CAircraftModelList findAllExcludedModels() const;
|
||||||
|
CAircraftModelList findAllExcludedModels(int maxElements) const;
|
||||||
|
//! @}
|
||||||
|
|
||||||
//! Take a designator and find its family
|
//! Take a designator and find its family
|
||||||
QString designatorToFamily(const Aviation::CAircraftIcaoCode &aircraftIcaoCode) const;
|
QString designatorToFamily(const Aviation::CAircraftIcaoCode &aircraftIcaoCode) const;
|
||||||
|
|||||||
@@ -154,12 +154,16 @@ namespace BlackMisc
|
|||||||
if (noDb > 0)
|
if (noDb > 0)
|
||||||
{
|
{
|
||||||
msgs.push_back(CStatusMessage(CLogCategory::matching(), CStatusMessage::SeverityWarning, QStringLiteral("%1 models without DB data, is this intended?").arg(noDb), true));
|
msgs.push_back(CStatusMessage(CLogCategory::matching(), CStatusMessage::SeverityWarning, QStringLiteral("%1 models without DB data, is this intended?").arg(noDb), true));
|
||||||
|
const QString ms = models.findWithoutValidDbKey(5).getModelStringList().join(", ");
|
||||||
|
msgs.push_back(CStatusMessage(CLogCategory::matching(), CStatusMessage::SeverityWarning, QStringLiteral("Some of the non DB models are: '%1'").arg(ms), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
const int noExcluded = models.countByMode(CAircraftModel::Exclude);
|
const int noExcluded = models.countByMode(CAircraftModel::Exclude);
|
||||||
if (noExcluded > 0)
|
if (noExcluded > 0)
|
||||||
{
|
{
|
||||||
msgs.push_back(CStatusMessage(CLogCategory::matching(), CStatusMessage::SeverityWarning, QStringLiteral("%1 models marked as excluded, is this intended?").arg(noExcluded), true));
|
msgs.push_back(CStatusMessage(CLogCategory::matching(), CStatusMessage::SeverityWarning, QStringLiteral("%1 models marked as excluded, is this intended?").arg(noExcluded), true));
|
||||||
|
const QString ms = models.findAllExcludedModels(5).getModelStringList().join(", ");
|
||||||
|
msgs.push_back(CStatusMessage(CLogCategory::matching(), CStatusMessage::SeverityWarning, QStringLiteral("Some of the excluded models are: '%1'").arg(ms), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
// specific checks for FSX/XPlane/FG
|
// specific checks for FSX/XPlane/FG
|
||||||
|
|||||||
Reference in New Issue
Block a user