Setting to display validation only in case of warnings/errors

This commit is contained in:
Klaus Basan
2019-05-07 02:32:14 +02:00
parent 2139fc2a5f
commit 7ac0450836
4 changed files with 31 additions and 9 deletions

View File

@@ -151,6 +151,7 @@ namespace BlackMisc
static const QString exExcl("excl.excluded");
static const QString removeFromModelSet("rem.from model set");
static const QString verification("Verify models at startup");
static const QString verificationWarn("Show only validation warnings/errors");
static const QString modelFailedAdded("Replace models failed to be added");
static const QString categoryGlider("glider categories");
static const QString categoryMilitary("military categories");
@@ -175,6 +176,7 @@ namespace BlackMisc
case ExcludeNoExcluded: return exExcl;
case ModelSetRemoveFailedModel: return removeFromModelSet;
case ModelVerificationAtStartup: return verification;
case ModelVerificationOnlyWarnError: return verificationWarn;
case ModelFailoverIfNoModelCanBeAdded: return modelFailedAdded;
default: break;
}
@@ -202,6 +204,7 @@ namespace BlackMisc
if (mode.testFlag(ScorePreferColorLiveries)) { modes << modeFlagToString(ScorePreferColorLiveries); }
if (mode.testFlag(ModelSetRemoveFailedModel)) { modes << modeFlagToString(ModelSetRemoveFailedModel); }
if (mode.testFlag(ModelVerificationAtStartup)) { modes << modeFlagToString(ModelVerificationAtStartup); }
if (mode.testFlag(ModelVerificationOnlyWarnError)) { modes << modeFlagToString(ModelVerificationOnlyWarnError); }
if (mode.testFlag(ModelFailoverIfNoModelCanBeAdded)) { modes << modeFlagToString(ModelFailoverIfNoModelCanBeAdded); }
return modes.join(", ");
@@ -231,7 +234,8 @@ namespace BlackMisc
bool byGliderCategory, bool byMilitaryCategory,
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
bool excludeNoDbData, bool excludeNoExcluded,
bool modelVerification, bool modelSetRemoveFailedModel, bool modelFailover)
bool modelVerification, bool modelVerificationWarnError,
bool modelSetRemoveFailedModel, bool modelFailover)
{
if (modelFailover) { modelSetRemoveFailedModel = true; } // otherwise this does not make sense
@@ -252,7 +256,8 @@ namespace BlackMisc
if (excludeNoExcluded) { mode |= ExcludeNoExcluded; }
if (modelSetRemoveFailedModel) { mode |= ModelSetRemoveFailedModel; }
if (modelVerification) { mode |= ModelVerificationAtStartup; }
if (modelFailover) { mode |= ModelFailoverIfNoModelCanBeAdded; }
if (modelVerificationWarnError) { mode |= ModelVerificationOnlyWarnError; }
if (modelFailover) { mode |= ModelFailoverIfNoModelCanBeAdded; }
return mode;
}
} // namespace

View File

@@ -59,6 +59,7 @@ namespace BlackMisc
// --- model set ---
ModelSetRemoveFailedModel = 1 << 15,
ModelVerificationAtStartup = 1 << 16,
ModelVerificationOnlyWarnError = 1 << 18, // later added, hence 18
ModelFailoverIfNoModelCanBeAdded = 1 << 17,
// --- others ---
@@ -116,6 +117,10 @@ namespace BlackMisc
//! \sa ModelVerificationOnStartup
bool doVerificationAtStartup() const { return this->getMatchingMode().testFlag(ModelVerificationAtStartup); }
//! Verification only shown for warning/errors?
//! \sa ModelVerificationOnlyWarnError
bool onlyShowVerificationWarningsAndErrors() const { return this->getMatchingMode().testFlag(ModelVerificationOnlyWarnError); }
//! Failover if model cannot be loaded
//! \sa ModelFailoverIfNoModelCanBeAdded
bool doModelAddFailover() const { return this->getMatchingMode().testFlag(ModelFailoverIfNoModelCanBeAdded); }
@@ -177,7 +182,7 @@ namespace BlackMisc
bool byForceMilitary, bool byForceCivilian,
bool byVtol, bool byGliderCategory, bool byMilitaryCategory,
bool scoreIgnoreZeros, bool scorePreferColorLiveries, bool excludeNoDbData, bool excludeNoExcluded,
bool modelVerification, bool modelSetRemoveFailedModel, bool modelFailover);
bool modelVerification, bool modelVerificationWarnError, bool modelSetRemoveFailedModel, bool modelFailover);
private:
int m_algorithm = static_cast<int>(MatchingStepwiseReducePlusScoreBased);