diff --git a/src/blackgui/editors/matchingform.cpp b/src/blackgui/editors/matchingform.cpp
index c2ef34711..80c12ced6 100644
--- a/src/blackgui/editors/matchingform.cpp
+++ b/src/blackgui/editors/matchingform.cpp
@@ -46,6 +46,7 @@ namespace BlackGui
CGuiUtility::checkBoxReadOnly(ui->cb_ByForceCivilian, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_ScoreIgnoreZeros, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_ScorePreferColorLiveries, readonly);
+ CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetRemoveFailed, readonly);
const bool enabled = !readonly;
ui->rb_Reduction->setEnabled(enabled);
@@ -80,6 +81,7 @@ namespace BlackGui
ui->cb_ScorePreferColorLiveries->setChecked(mode.testFlag(CAircraftMatcherSetup::ScorePreferColorLiveries));
ui->cb_ExclNoExcludedModels->setChecked(mode.testFlag(CAircraftMatcherSetup::ExcludeNoExcluded));
ui->cb_ExclNoDbData->setChecked(mode.testFlag(CAircraftMatcherSetup::ExcludeNoDbData));
+ ui->cb_ModelSetRemoveFailed->setChecked(mode.testFlag(CAircraftMatcherSetup::ModelSetRemoveFailedModel));
this->setMatchingAlgorithm(setup);
this->setPickStrategy(setup);
@@ -115,7 +117,8 @@ namespace BlackGui
ui->cb_ByForceCivilian->isChecked(),
ui->cb_ByVtol->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()
);
}
diff --git a/src/blackgui/editors/matchingform.ui b/src/blackgui/editors/matchingform.ui
index 59f57e5d7..ef5a072de 100644
--- a/src/blackgui/editors/matchingform.ui
+++ b/src/blackgui/editors/matchingform.ui
@@ -7,7 +7,7 @@
0
0
293
- 375
+ 438
@@ -105,10 +105,40 @@
Reduction
- -
-
+
-
+
+
+ Vertical Takeoff or Landing
+
- by ICAO: airline first
+ VTOL (helicopters and such)
+
+
+
+ -
+
+
+ inbound military force matched military
+
+
+ force military
+
+
+
+ -
+
+
+ inbound civilian force matched civilian
+
+
+ force civilian
+
+
+
+ -
+
+
+ livery
@@ -119,6 +149,13 @@
+ -
+
+
+ by ICAO: airline first
+
+
+
-
@@ -126,10 +163,10 @@
- -
-
+
-
+
- livery
+ family
@@ -147,40 +184,19 @@
- -
-
+
+
+
+ -
+
+
+ Failure handling
+
+
+
-
+
- family
-
-
-
- -
-
-
- inbound military force matched military
-
-
- force military
-
-
-
- -
-
-
- Vertical Takeoff or Landing
-
-
- VTOL (helicopters and such)
-
-
-
- -
-
-
- inbound civilian force matched civilian
-
-
- force civilian
+ removed failed from set
diff --git a/src/blackmisc/simulation/aircraftmatchersetup.cpp b/src/blackmisc/simulation/aircraftmatchersetup.cpp
index 06d7f7769..a88cea64a 100644
--- a/src/blackmisc/simulation/aircraftmatchersetup.cpp
+++ b/src/blackmisc/simulation/aircraftmatchersetup.cpp
@@ -134,6 +134,7 @@ namespace BlackMisc
static const QString preferColorLiveries("scoring, prefer color liveries");
static const QString exNoDb("excl.without DB data");
static const QString exExcl("excl.excluded");
+ static const QString remModelSet("rem.from model set");
switch (modeFlag)
{
@@ -151,6 +152,7 @@ namespace BlackMisc
case ScorePreferColorLiveries: return preferColorLiveries;
case ExcludeNoDbData: return exNoDb;
case ExcludeNoExcluded: return exExcl;
+ case ModelSetRemoveFailedModel: return remModelSet;
default: break;
}
@@ -172,7 +174,8 @@ namespace BlackMisc
if (mode.testFlag(ByForceMilitary)) { modes << modeFlagToString(ByForceMilitary); }
if (mode.testFlag(ByVtol)) { modes << modeFlagToString(ByVtol); }
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); }
return modes.join(", ");
}
@@ -198,7 +201,8 @@ namespace BlackMisc
bool byForceMilitary, bool byForceCivilian,
bool byVtol,
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
- bool excludeNoDbData, bool excludeNoExcluded)
+ bool excludeNoDbData, bool excludeNoExcluded,
+ bool modelSetRemoveFailedModel)
{
MatchingMode mode = byModelString ? ByModelString : ModeNone;
if (byIcaoDataAircraft1st) { mode |= ByIcaoOrderAircraftFirst; }
@@ -213,6 +217,7 @@ namespace BlackMisc
if (scorePreferColorLiveries) { mode |= ScorePreferColorLiveries; }
if (excludeNoDbData) { mode |= ExcludeNoDbData; }
if (excludeNoExcluded) { mode |= ExcludeNoExcluded; }
+ if (modelSetRemoveFailedModel) { mode |= ModelSetRemoveFailedModel; }
return mode;
}
} // namespace
diff --git a/src/blackmisc/simulation/aircraftmatchersetup.h b/src/blackmisc/simulation/aircraftmatchersetup.h
index 02a7a27d4..faa29f4a1 100644
--- a/src/blackmisc/simulation/aircraftmatchersetup.h
+++ b/src/blackmisc/simulation/aircraftmatchersetup.h
@@ -54,6 +54,8 @@ namespace BlackMisc
ExcludeNoDbData = 1 << 13,
ExcludeNoExcluded = 1 << 14,
ExcludeDefault = ExcludeNoExcluded | ExcludeNoDbData,
+ // --- model set ---
+ ModelSetRemoveFailedModel = 1 << 15,
// --- others ---
ModeNone = 0,
ModeByFLags = ByMilitary | ByVtol,
@@ -106,6 +108,9 @@ namespace BlackMisc
//! Dynamic offset values?
void setMatchingMode(MatchingMode mode) { m_mode = static_cast(mode); }
+ //! Remove if failed?
+ bool removeFromSetIfFailed() const { return this->getMatchingMode().testFlag(ModelSetRemoveFailedModel); }
+
//! Strategy among equally suitable models
PickSimilarStrategy getPickStrategy() const { return static_cast(m_strategy); }
@@ -144,7 +149,8 @@ namespace BlackMisc
bool byFamily, bool byLivery, bool byCombinedType,
bool byForceMilitary, bool byForceCivilian,
bool byVtol,
- bool scoreIgnoreZeros, bool scorePreferColorLiveries, bool excludeNoDbData, bool excludeNoExcluded);
+ bool scoreIgnoreZeros, bool scorePreferColorLiveries, bool excludeNoDbData, bool excludeNoExcluded,
+ bool modelSetRemoveFailedModel);
private:
int m_algorithm = static_cast(MatchingStepwiseReducePlusScoreBased);