mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
Ref T515, settings for matching (run validation)
This commit is contained in:
committed by
Mat Sutcliffe
parent
e46b7f5494
commit
da92f3885c
@@ -28,7 +28,6 @@ namespace BlackGui
|
|||||||
connect(ui->rb_Reduction, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
|
connect(ui->rb_Reduction, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
|
||||||
connect(ui->rb_ScoreAndReduction, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
|
connect(ui->rb_ScoreAndReduction, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
|
||||||
connect(ui->rb_ScoreOnly, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
|
connect(ui->rb_ScoreOnly, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
|
||||||
|
|
||||||
connect(ui->pb_Reset, &QPushButton::released, this, &CMatchingForm::clear, Qt::QueuedConnection);
|
connect(ui->pb_Reset, &QPushButton::released, this, &CMatchingForm::clear, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,6 +46,8 @@ namespace BlackGui
|
|||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ScoreIgnoreZeros, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ScoreIgnoreZeros, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ScorePreferColorLiveries, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ScorePreferColorLiveries, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetRemoveFailed, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetRemoveFailed, readonly);
|
||||||
|
CGuiUtility::checkBoxReadOnly(ui->cb_ModelFailedFailover, readonly);
|
||||||
|
CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetVerification, readonly);
|
||||||
|
|
||||||
const bool enabled = !readonly;
|
const bool enabled = !readonly;
|
||||||
ui->rb_Reduction->setEnabled(enabled);
|
ui->rb_Reduction->setEnabled(enabled);
|
||||||
@@ -82,6 +83,8 @@ namespace BlackGui
|
|||||||
ui->cb_ExclNoExcludedModels->setChecked(mode.testFlag(CAircraftMatcherSetup::ExcludeNoExcluded));
|
ui->cb_ExclNoExcludedModels->setChecked(mode.testFlag(CAircraftMatcherSetup::ExcludeNoExcluded));
|
||||||
ui->cb_ExclNoDbData->setChecked(mode.testFlag(CAircraftMatcherSetup::ExcludeNoDbData));
|
ui->cb_ExclNoDbData->setChecked(mode.testFlag(CAircraftMatcherSetup::ExcludeNoDbData));
|
||||||
ui->cb_ModelSetRemoveFailed->setChecked(mode.testFlag(CAircraftMatcherSetup::ModelSetRemoveFailedModel));
|
ui->cb_ModelSetRemoveFailed->setChecked(mode.testFlag(CAircraftMatcherSetup::ModelSetRemoveFailedModel));
|
||||||
|
ui->cb_ModelFailedFailover->setChecked(mode.testFlag(CAircraftMatcherSetup::ModelFailoverWhenNoModelCanBeLoaded));
|
||||||
|
ui->cb_ModelSetVerification->setChecked(mode.testFlag(CAircraftMatcherSetup::ModelVerificationAtStartup));
|
||||||
|
|
||||||
this->setMatchingAlgorithm(setup);
|
this->setMatchingAlgorithm(setup);
|
||||||
this->setPickStrategy(setup);
|
this->setPickStrategy(setup);
|
||||||
@@ -118,7 +121,8 @@ namespace BlackGui
|
|||||||
ui->cb_ByVtol->isChecked(),
|
ui->cb_ByVtol->isChecked(),
|
||||||
ui->cb_ScoreIgnoreZeros->isChecked(), ui->cb_ScorePreferColorLiveries->isChecked(),
|
ui->cb_ScoreIgnoreZeros->isChecked(), ui->cb_ScorePreferColorLiveries->isChecked(),
|
||||||
ui->cb_ExclNoDbData->isChecked(), ui->cb_ExclNoExcludedModels->isChecked(),
|
ui->cb_ExclNoDbData->isChecked(), ui->cb_ExclNoExcludedModels->isChecked(),
|
||||||
ui->cb_ModelSetRemoveFailed->isChecked()
|
ui->cb_ModelSetVerification->isChecked(), ui->cb_ModelSetRemoveFailed->isChecked(),
|
||||||
|
ui->cb_ModelFailedFailover->isChecked()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>293</width>
|
<width>293</width>
|
||||||
<height>453</height>
|
<height>465</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -190,13 +190,30 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="gb_FailureHandling">
|
<widget class="QGroupBox" name="gb_FailureHandling">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Failure handling</string>
|
<string>Failure handling and verification</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="hFailureHandling">
|
<layout class="QGridLayout" name="gl_FailureHandling">
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="cb_ModelSetRemoveFailed">
|
<widget class="QCheckBox" name="cb_ModelSetRemoveFailed">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>temp.remove failed from model set</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>removed failed from set</string>
|
<string>temp.remove failed</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="cb_ModelSetVerification">
|
||||||
|
<property name="text">
|
||||||
|
<string>verify set on startup</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QCheckBox" name="cb_ModelFailedFailover">
|
||||||
|
<property name="text">
|
||||||
|
<string>use other model if failed</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -215,7 +232,7 @@
|
|||||||
<string>models marked as excluded are ignored</string>
|
<string>models marked as excluded are ignored</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Excluded models</string>
|
<string>excluded models</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -225,7 +242,7 @@
|
|||||||
<string>models without DB data are ignored</string>
|
<string>models without DB data are ignored</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Exclude if no DB data</string>
|
<string>exclude if no DB data</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -274,7 +291,9 @@
|
|||||||
<tabstop>cb_ByVtol</tabstop>
|
<tabstop>cb_ByVtol</tabstop>
|
||||||
<tabstop>cb_ByForceMilitary</tabstop>
|
<tabstop>cb_ByForceMilitary</tabstop>
|
||||||
<tabstop>cb_ByForceCivilian</tabstop>
|
<tabstop>cb_ByForceCivilian</tabstop>
|
||||||
|
<tabstop>cb_ModelSetVerification</tabstop>
|
||||||
<tabstop>cb_ModelSetRemoveFailed</tabstop>
|
<tabstop>cb_ModelSetRemoveFailed</tabstop>
|
||||||
|
<tabstop>cb_ModelFailedFailover</tabstop>
|
||||||
<tabstop>cb_ExclNoExcludedModels</tabstop>
|
<tabstop>cb_ExclNoExcludedModels</tabstop>
|
||||||
<tabstop>cb_ExclNoDbData</tabstop>
|
<tabstop>cb_ExclNoDbData</tabstop>
|
||||||
<tabstop>cb_ScorePreferColorLiveries</tabstop>
|
<tabstop>cb_ScorePreferColorLiveries</tabstop>
|
||||||
|
|||||||
@@ -45,6 +45,13 @@ namespace BlackMisc
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CAircraftMatcherSetup::setVerificationAtStartup(bool verify)
|
||||||
|
{
|
||||||
|
MatchingMode m = this->getMatchingMode();
|
||||||
|
m.setFlag(ModelVerificationAtStartup, verify);
|
||||||
|
this->setMatchingMode(m);
|
||||||
|
}
|
||||||
|
|
||||||
QString CAircraftMatcherSetup::convertToQString(bool i18n) const
|
QString CAircraftMatcherSetup::convertToQString(bool i18n) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(i18n);
|
Q_UNUSED(i18n);
|
||||||
@@ -88,12 +95,8 @@ namespace BlackMisc
|
|||||||
MatchingMode mode = ModeNone;
|
MatchingMode mode = ModeNone;
|
||||||
switch (algorithm)
|
switch (algorithm)
|
||||||
{
|
{
|
||||||
case MatchingStepwiseReduce:
|
case MatchingStepwiseReduce: mode = ModeDefaultReduce; break;
|
||||||
mode = ModeDefaultReduce;
|
case MatchingScoreBased: mode = ModeDefaultScore; break;
|
||||||
break;
|
|
||||||
case MatchingScoreBased:
|
|
||||||
mode = ModeDefaultScore;
|
|
||||||
break;
|
|
||||||
case MatchingStepwiseReducePlusScoreBased:
|
case MatchingStepwiseReducePlusScoreBased:
|
||||||
default:
|
default:
|
||||||
mode = ModeDefaultReducePlusScore;
|
mode = ModeDefaultReducePlusScore;
|
||||||
@@ -134,7 +137,9 @@ namespace BlackMisc
|
|||||||
static const QString preferColorLiveries("scoring, prefer color liveries");
|
static const QString preferColorLiveries("scoring, prefer color liveries");
|
||||||
static const QString exNoDb("excl.without DB data");
|
static const QString exNoDb("excl.without DB data");
|
||||||
static const QString exExcl("excl.excluded");
|
static const QString exExcl("excl.excluded");
|
||||||
static const QString remModelSet("rem.from model set");
|
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");
|
||||||
|
|
||||||
switch (modeFlag)
|
switch (modeFlag)
|
||||||
{
|
{
|
||||||
@@ -152,7 +157,9 @@ namespace BlackMisc
|
|||||||
case ScorePreferColorLiveries: return preferColorLiveries;
|
case ScorePreferColorLiveries: return preferColorLiveries;
|
||||||
case ExcludeNoDbData: return exNoDb;
|
case ExcludeNoDbData: return exNoDb;
|
||||||
case ExcludeNoExcluded: return exExcl;
|
case ExcludeNoExcluded: return exExcl;
|
||||||
case ModelSetRemoveFailedModel: return remModelSet;
|
case ModelSetRemoveFailedModel: return removeFromModelSet;
|
||||||
|
case ModelVerificationAtStartup: return verification;
|
||||||
|
case ModelFailoverWhenNoModelCanBeLoaded: return modelFailedLoad;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,6 +183,9 @@ namespace BlackMisc
|
|||||||
if (mode.testFlag(ScoreIgnoreZeros)) { modes << modeFlagToString(ScoreIgnoreZeros); }
|
if (mode.testFlag(ScoreIgnoreZeros)) { modes << modeFlagToString(ScoreIgnoreZeros); }
|
||||||
if (mode.testFlag(ScorePreferColorLiveries)) { modes << modeFlagToString(ScorePreferColorLiveries); }
|
if (mode.testFlag(ScorePreferColorLiveries)) { modes << modeFlagToString(ScorePreferColorLiveries); }
|
||||||
if (mode.testFlag(ModelSetRemoveFailedModel)) { modes << modeFlagToString(ModelSetRemoveFailedModel); }
|
if (mode.testFlag(ModelSetRemoveFailedModel)) { modes << modeFlagToString(ModelSetRemoveFailedModel); }
|
||||||
|
if (mode.testFlag(ModelVerificationAtStartup)) { modes << modeFlagToString(ModelVerificationAtStartup); }
|
||||||
|
if (mode.testFlag(ModelFailoverWhenNoModelCanBeLoaded)) { modes << modeFlagToString(ModelFailoverWhenNoModelCanBeLoaded); }
|
||||||
|
|
||||||
return modes.join(", ");
|
return modes.join(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +212,7 @@ namespace BlackMisc
|
|||||||
bool byVtol,
|
bool byVtol,
|
||||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
|
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
|
||||||
bool excludeNoDbData, bool excludeNoExcluded,
|
bool excludeNoDbData, bool excludeNoExcluded,
|
||||||
bool modelSetRemoveFailedModel)
|
bool modelVerification, bool modelSetRemoveFailedModel, bool modelFailover)
|
||||||
{
|
{
|
||||||
MatchingMode mode = byModelString ? ByModelString : ModeNone;
|
MatchingMode mode = byModelString ? ByModelString : ModeNone;
|
||||||
if (byIcaoDataAircraft1st) { mode |= ByIcaoOrderAircraftFirst; }
|
if (byIcaoDataAircraft1st) { mode |= ByIcaoOrderAircraftFirst; }
|
||||||
@@ -218,6 +228,8 @@ namespace BlackMisc
|
|||||||
if (excludeNoDbData) { mode |= ExcludeNoDbData; }
|
if (excludeNoDbData) { mode |= ExcludeNoDbData; }
|
||||||
if (excludeNoExcluded) { mode |= ExcludeNoExcluded; }
|
if (excludeNoExcluded) { mode |= ExcludeNoExcluded; }
|
||||||
if (modelSetRemoveFailedModel) { mode |= ModelSetRemoveFailedModel; }
|
if (modelSetRemoveFailedModel) { mode |= ModelSetRemoveFailedModel; }
|
||||||
|
if (modelVerification) { mode |= ModelVerificationAtStartup; }
|
||||||
|
if (modelFailover) { mode |= ModelFailoverWhenNoModelCanBeLoaded; }
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -56,12 +56,17 @@ namespace BlackMisc
|
|||||||
ExcludeDefault = ExcludeNoExcluded | ExcludeNoDbData,
|
ExcludeDefault = ExcludeNoExcluded | ExcludeNoDbData,
|
||||||
// --- model set ---
|
// --- model set ---
|
||||||
ModelSetRemoveFailedModel = 1 << 15,
|
ModelSetRemoveFailedModel = 1 << 15,
|
||||||
|
ModelVerificationAtStartup = 1 << 16,
|
||||||
|
ModelFailoverWhenNoModelCanBeLoaded = 1 << 17,
|
||||||
// --- others ---
|
// --- others ---
|
||||||
ModeNone = 0,
|
ModeNone = 0,
|
||||||
ModeByFLags = ByMilitary | ByVtol,
|
ModeByFLags = ByMilitary | ByVtol,
|
||||||
|
// ModeDefaultSet = ModelSetRemoveFailedModel | ModelVerificationAtStartup | ModelFailoverWhenNoModelCanBeLoaded,
|
||||||
|
ModeDefaultSet = ModelSetRemoveFailedModel | ModelFailoverWhenNoModelCanBeLoaded,
|
||||||
ModeDefaultScore = ScoreIgnoreZeros | ScorePreferColorLiveries | ExcludeDefault,
|
ModeDefaultScore = ScoreIgnoreZeros | ScorePreferColorLiveries | ExcludeDefault,
|
||||||
ModeDefaultReduce = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ByLivery | ExcludeDefault,
|
ModeDefaultReduce = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ByLivery | ExcludeDefault,
|
||||||
ModeDefaultReducePlusScore = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ModeDefaultScore | ExcludeDefault
|
ModeDefaultReducePlusScore = ModeByFLags | ByModelString | ByFamily | ByManufacturer | ByCombinedType | ByIcaoOrderAircraftFirst | ModeDefaultScore | ExcludeDefault,
|
||||||
|
ModeDefault = ModeDefaultReducePlusScore | ModeDefaultSet
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(MatchingMode, MatchingModeFlag)
|
Q_DECLARE_FLAGS(MatchingMode, MatchingModeFlag)
|
||||||
|
|
||||||
@@ -102,6 +107,13 @@ namespace BlackMisc
|
|||||||
//! Matching mode
|
//! Matching mode
|
||||||
MatchingMode getMatchingMode() const { return static_cast<MatchingMode>(m_mode); }
|
MatchingMode getMatchingMode() const { return static_cast<MatchingMode>(m_mode); }
|
||||||
|
|
||||||
|
//! Verification at startup?
|
||||||
|
//! \sa ModelVerificationOnStartup
|
||||||
|
bool doVerificationAtStartup() const { return this->getMatchingMode().testFlag(ModelVerificationAtStartup); }
|
||||||
|
|
||||||
|
//! Set startup verification
|
||||||
|
void setVerificationAtStartup(bool verify);
|
||||||
|
|
||||||
//! Matching mode as string
|
//! Matching mode as string
|
||||||
QString getMatchingModeAsString() const { return modeToString(this->getMatchingMode()); }
|
QString getMatchingModeAsString() const { return modeToString(this->getMatchingMode()); }
|
||||||
|
|
||||||
@@ -150,10 +162,10 @@ namespace BlackMisc
|
|||||||
bool byForceMilitary, bool byForceCivilian,
|
bool byForceMilitary, bool byForceCivilian,
|
||||||
bool byVtol,
|
bool byVtol,
|
||||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries, bool excludeNoDbData, bool excludeNoExcluded,
|
bool scoreIgnoreZeros, bool scorePreferColorLiveries, bool excludeNoDbData, bool excludeNoExcluded,
|
||||||
bool modelSetRemoveFailedModel);
|
bool modelVerification, bool modelSetRemoveFailedModel, bool modelFailover);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_algorithm = static_cast<int>(MatchingStepwiseReducePlusScoreBased);
|
int m_algorithm = static_cast<int>(ModeDefault);
|
||||||
int m_mode = static_cast<int>(ModeDefaultReducePlusScore);
|
int m_mode = static_cast<int>(ModeDefaultReducePlusScore);
|
||||||
int m_strategy = static_cast<int>(PickByOrder);
|
int m_strategy = static_cast<int>(PickByOrder);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user