mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
Ref T515, added failover flag for addingRemoteModelFailed
* adjusted signatures * renamings and minor style adjustments
This commit is contained in:
committed by
Mat Sutcliffe
parent
f316c63fbe
commit
6470c61d0a
@@ -139,7 +139,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 modelFailedLoad("Replace models failed to load");
|
||||
static const QString modelFailedAdded("Replace models failed to be added");
|
||||
|
||||
switch (modeFlag)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ namespace BlackMisc
|
||||
case ExcludeNoExcluded: return exExcl;
|
||||
case ModelSetRemoveFailedModel: return removeFromModelSet;
|
||||
case ModelVerificationAtStartup: return verification;
|
||||
case ModelFailoverWhenNoModelCanBeLoaded: return modelFailedLoad;
|
||||
case ModelFailoverIfNoModelCanBeAdded: return modelFailedAdded;
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -184,7 +184,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(ModelFailoverWhenNoModelCanBeLoaded)) { modes << modeFlagToString(ModelFailoverWhenNoModelCanBeLoaded); }
|
||||
if (mode.testFlag(ModelFailoverIfNoModelCanBeAdded)) { modes << modeFlagToString(ModelFailoverIfNoModelCanBeAdded); }
|
||||
|
||||
return modes.join(", ");
|
||||
}
|
||||
@@ -229,7 +229,7 @@ namespace BlackMisc
|
||||
if (excludeNoExcluded) { mode |= ExcludeNoExcluded; }
|
||||
if (modelSetRemoveFailedModel) { mode |= ModelSetRemoveFailedModel; }
|
||||
if (modelVerification) { mode |= ModelVerificationAtStartup; }
|
||||
if (modelFailover) { mode |= ModelFailoverWhenNoModelCanBeLoaded; }
|
||||
if (modelFailover) { mode |= ModelFailoverIfNoModelCanBeAdded; }
|
||||
return mode;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -55,14 +55,14 @@ namespace BlackMisc
|
||||
ExcludeNoExcluded = 1 << 14,
|
||||
ExcludeDefault = ExcludeNoExcluded | ExcludeNoDbData,
|
||||
// --- model set ---
|
||||
ModelSetRemoveFailedModel = 1 << 15,
|
||||
ModelVerificationAtStartup = 1 << 16,
|
||||
ModelFailoverWhenNoModelCanBeLoaded = 1 << 17,
|
||||
ModelSetRemoveFailedModel = 1 << 15,
|
||||
ModelVerificationAtStartup = 1 << 16,
|
||||
ModelFailoverIfNoModelCanBeAdded = 1 << 17,
|
||||
// --- others ---
|
||||
ModeNone = 0,
|
||||
ModeByFLags = ByMilitary | ByVtol,
|
||||
// ModeDefaultSet = ModelSetRemoveFailedModel | ModelVerificationAtStartup | ModelFailoverWhenNoModelCanBeLoaded,
|
||||
ModeDefaultSet = ModelSetRemoveFailedModel | ModelFailoverWhenNoModelCanBeLoaded,
|
||||
ModeDefaultSet = ModelSetRemoveFailedModel | ModelFailoverIfNoModelCanBeAdded,
|
||||
ModeDefaultScore = ScoreIgnoreZeros | ScorePreferColorLiveries | ExcludeDefault,
|
||||
ModeDefaultReduce = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ByLivery | ExcludeDefault,
|
||||
ModeDefaultReducePlusScore = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ModeDefaultScore | ExcludeDefault,
|
||||
@@ -111,6 +111,10 @@ namespace BlackMisc
|
||||
//! \sa ModelVerificationOnStartup
|
||||
bool doVerificationAtStartup() const { return this->getMatchingMode().testFlag(ModelVerificationAtStartup); }
|
||||
|
||||
//! Failover if model cannot be loaded
|
||||
//! \sa ModelFailoverIfNoModelCanBeAdded
|
||||
bool doModelAddFailover() const { return this->getMatchingMode().testFlag(ModelFailoverIfNoModelCanBeAdded); }
|
||||
|
||||
//! Set startup verification
|
||||
void setVerificationAtStartup(bool verify);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user