mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 13:55:36 +08:00
Ref T472, matching settings/setup for categories
This commit is contained in:
committed by
Mat Sutcliffe
parent
6ca6d12851
commit
530bd38f00
@@ -32,14 +32,6 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="qw_MatchingForm">
|
<widget class="QWidget" name="qw_MatchingForm">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>296</width>
|
|
||||||
<height>450</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="vl_ScrollAreaContent">
|
<layout class="QVBoxLayout" name="vl_ScrollAreaContent">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
@@ -58,7 +50,7 @@
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>450</height>
|
<height>550</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ 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_ResetAlgorithm, &QPushButton::released, this, &CMatchingForm::resetByAlgorithm, Qt::QueuedConnection);
|
||||||
|
connect(ui->pb_ResetAll, &QPushButton::released, this, &CMatchingForm::resetAll, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
CMatchingForm::~CMatchingForm()
|
CMatchingForm::~CMatchingForm()
|
||||||
@@ -47,6 +48,8 @@ namespace BlackGui
|
|||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetRemoveFailed, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetRemoveFailed, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ModelFailedFailover, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ModelFailedFailover, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetVerification, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetVerification, readonly);
|
||||||
|
CGuiUtility::checkBoxReadOnly(ui->cb_CategoryGlider, readonly);
|
||||||
|
CGuiUtility::checkBoxReadOnly(ui->cb_CategoryMilitaryAircraft, readonly);
|
||||||
|
|
||||||
const bool enabled = !readonly;
|
const bool enabled = !readonly;
|
||||||
ui->rb_Reduction->setEnabled(enabled);
|
ui->rb_Reduction->setEnabled(enabled);
|
||||||
@@ -76,6 +79,8 @@ namespace BlackGui
|
|||||||
ui->cb_ByFamily->setChecked(mode.testFlag(CAircraftMatcherSetup::ByFamily));
|
ui->cb_ByFamily->setChecked(mode.testFlag(CAircraftMatcherSetup::ByFamily));
|
||||||
ui->cb_ByForceMilitary->setChecked(mode.testFlag(CAircraftMatcherSetup::ByForceMilitary));
|
ui->cb_ByForceMilitary->setChecked(mode.testFlag(CAircraftMatcherSetup::ByForceMilitary));
|
||||||
ui->cb_ByForceCivilian->setChecked(mode.testFlag(CAircraftMatcherSetup::ByForceCivilian));
|
ui->cb_ByForceCivilian->setChecked(mode.testFlag(CAircraftMatcherSetup::ByForceCivilian));
|
||||||
|
ui->cb_CategoryGlider->setChecked(mode.testFlag(CAircraftMatcherSetup::ByCategoryGlider));
|
||||||
|
ui->cb_CategoryMilitaryAircraft->setChecked(mode.testFlag(CAircraftMatcherSetup::ByCategoryMilitary));
|
||||||
ui->cb_ByVtol->setChecked(mode.testFlag(CAircraftMatcherSetup::ByVtol));
|
ui->cb_ByVtol->setChecked(mode.testFlag(CAircraftMatcherSetup::ByVtol));
|
||||||
ui->cb_ScoreIgnoreZeros->setChecked(mode.testFlag(CAircraftMatcherSetup::ScoreIgnoreZeros));
|
ui->cb_ScoreIgnoreZeros->setChecked(mode.testFlag(CAircraftMatcherSetup::ScoreIgnoreZeros));
|
||||||
ui->cb_ScorePreferColorLiveries->setChecked(mode.testFlag(CAircraftMatcherSetup::ScorePreferColorLiveries));
|
ui->cb_ScorePreferColorLiveries->setChecked(mode.testFlag(CAircraftMatcherSetup::ScorePreferColorLiveries));
|
||||||
@@ -97,7 +102,18 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CMatchingForm::clear()
|
void CMatchingForm::clear()
|
||||||
{
|
{
|
||||||
const CAircraftMatcherSetup s(algorithm());
|
this->resetAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMatchingForm::resetByAlgorithm()
|
||||||
|
{
|
||||||
|
const CAircraftMatcherSetup s(this->algorithm());
|
||||||
|
this->setValue(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMatchingForm::resetAll()
|
||||||
|
{
|
||||||
|
const CAircraftMatcherSetup s;
|
||||||
this->setValue(s);
|
this->setValue(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,6 +134,8 @@ namespace BlackGui
|
|||||||
ui->cb_ByForceMilitary->isChecked(),
|
ui->cb_ByForceMilitary->isChecked(),
|
||||||
ui->cb_ByForceCivilian->isChecked(),
|
ui->cb_ByForceCivilian->isChecked(),
|
||||||
ui->cb_ByVtol->isChecked(),
|
ui->cb_ByVtol->isChecked(),
|
||||||
|
ui->cb_CategoryGlider->isChecked(),
|
||||||
|
ui->cb_CategoryMilitaryAircraft->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_ModelSetVerification->isChecked(), ui->cb_ModelSetRemoveFailed->isChecked(),
|
ui->cb_ModelSetVerification->isChecked(), ui->cb_ModelSetRemoveFailed->isChecked(),
|
||||||
@@ -172,5 +190,6 @@ namespace BlackGui
|
|||||||
const CAircraftMatcherSetup setup = this->value();
|
const CAircraftMatcherSetup setup = this->value();
|
||||||
this->setValue(setup);
|
this->setValue(setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -66,6 +66,11 @@ namespace BlackGui
|
|||||||
//! Algorithm has been toggled
|
//! Algorithm has been toggled
|
||||||
void onAlgorithmChanged();
|
void onAlgorithmChanged();
|
||||||
|
|
||||||
|
//! Reset @{
|
||||||
|
void resetByAlgorithm();
|
||||||
|
void resetAll();
|
||||||
|
//! }
|
||||||
|
|
||||||
QScopedPointer<Ui::CMatchingForm> ui;
|
QScopedPointer<Ui::CMatchingForm> ui;
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -2,14 +2,6 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CMatchingForm</class>
|
<class>CMatchingForm</class>
|
||||||
<widget class="QFrame" name="CMatchingForm">
|
<widget class="QFrame" name="CMatchingForm">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>293</width>
|
|
||||||
<height>465</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Matching form</string>
|
<string>Matching form</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -26,6 +18,13 @@
|
|||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QPushButton" name="pb_ResetAll">
|
||||||
|
<property name="text">
|
||||||
|
<string>reset (all)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="gb_Algorithm">
|
<widget class="QGroupBox" name="gb_Algorithm">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@@ -54,9 +53,9 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2" alignment="Qt::AlignRight">
|
<item row="3" column="2" alignment="Qt::AlignRight">
|
||||||
<widget class="QPushButton" name="pb_Reset">
|
<widget class="QPushButton" name="pb_ResetAlgorithm">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>reset</string>
|
<string>reset (by algorithm)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -187,6 +186,29 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="gb_Categories">
|
||||||
|
<property name="title">
|
||||||
|
<string>Matching by categories</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="cb_CategoryGlider">
|
||||||
|
<property name="text">
|
||||||
|
<string>Glider</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QCheckBox" name="cb_CategoryMilitaryAircraft">
|
||||||
|
<property name="text">
|
||||||
|
<string>military aircraft</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="gb_FailureHandling">
|
<widget class="QGroupBox" name="gb_FailureHandling">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@@ -278,7 +300,7 @@
|
|||||||
<tabstop>rb_Reduction</tabstop>
|
<tabstop>rb_Reduction</tabstop>
|
||||||
<tabstop>rb_ScoreOnly</tabstop>
|
<tabstop>rb_ScoreOnly</tabstop>
|
||||||
<tabstop>rb_ScoreAndReduction</tabstop>
|
<tabstop>rb_ScoreAndReduction</tabstop>
|
||||||
<tabstop>pb_Reset</tabstop>
|
<tabstop>pb_ResetAlgorithm</tabstop>
|
||||||
<tabstop>rb_PickFirst</tabstop>
|
<tabstop>rb_PickFirst</tabstop>
|
||||||
<tabstop>rb_PickRandom</tabstop>
|
<tabstop>rb_PickRandom</tabstop>
|
||||||
<tabstop>rb_PickByOrder</tabstop>
|
<tabstop>rb_PickByOrder</tabstop>
|
||||||
@@ -291,6 +313,8 @@
|
|||||||
<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_CategoryGlider</tabstop>
|
||||||
|
<tabstop>cb_CategoryMilitaryAircraft</tabstop>
|
||||||
<tabstop>cb_ModelSetVerification</tabstop>
|
<tabstop>cb_ModelSetVerification</tabstop>
|
||||||
<tabstop>cb_ModelSetRemoveFailed</tabstop>
|
<tabstop>cb_ModelSetRemoveFailed</tabstop>
|
||||||
<tabstop>cb_ModelFailedFailover</tabstop>
|
<tabstop>cb_ModelFailedFailover</tabstop>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
CAircraftMatcherSetup::CAircraftMatcherSetup()
|
CAircraftMatcherSetup::CAircraftMatcherSetup()
|
||||||
{
|
{
|
||||||
this->reset(MatchingStepwiseReducePlusScoreBased);
|
this->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftMatcherSetup::CAircraftMatcherSetup(CAircraftMatcherSetup::MatchingAlgorithm algorithm)
|
CAircraftMatcherSetup::CAircraftMatcherSetup(CAircraftMatcherSetup::MatchingAlgorithm algorithm)
|
||||||
@@ -88,6 +88,11 @@ namespace BlackMisc
|
|||||||
CValueObject::setPropertyByIndex(index, variant);
|
CValueObject::setPropertyByIndex(index, variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CAircraftMatcherSetup::reset()
|
||||||
|
{
|
||||||
|
this->reset(MatchingStepwiseReducePlusScoreBased);
|
||||||
|
}
|
||||||
|
|
||||||
void CAircraftMatcherSetup::reset(CAircraftMatcherSetup::MatchingAlgorithm algorithm)
|
void CAircraftMatcherSetup::reset(CAircraftMatcherSetup::MatchingAlgorithm algorithm)
|
||||||
{
|
{
|
||||||
m_algorithm = static_cast<int>(algorithm);
|
m_algorithm = static_cast<int>(algorithm);
|
||||||
@@ -101,6 +106,8 @@ namespace BlackMisc
|
|||||||
mode = ModeDefaultReducePlusScore;
|
mode = ModeDefaultReducePlusScore;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
mode |= ModeDefaultSet; // add set default
|
||||||
|
|
||||||
this->setMatchingMode(mode);
|
this->setMatchingMode(mode);
|
||||||
this->setPickStrategy(PickByOrder);
|
this->setPickStrategy(PickByOrder);
|
||||||
}
|
}
|
||||||
@@ -139,6 +146,8 @@ namespace BlackMisc
|
|||||||
static const QString removeFromModelSet("rem.from model set");
|
static const QString removeFromModelSet("rem.from model set");
|
||||||
static const QString verification("Verify models at startup");
|
static const QString verification("Verify models at startup");
|
||||||
static const QString modelFailedAdded("Replace models failed to be added");
|
static const QString modelFailedAdded("Replace models failed to be added");
|
||||||
|
static const QString categoryGlider("glider categories");
|
||||||
|
static const QString categoryMilitary("military categories");
|
||||||
|
|
||||||
switch (modeFlag)
|
switch (modeFlag)
|
||||||
{
|
{
|
||||||
@@ -152,6 +161,8 @@ namespace BlackMisc
|
|||||||
case ByForceCivilian: return forceCiv;
|
case ByForceCivilian: return forceCiv;
|
||||||
case ByForceMilitary: return forceMil;
|
case ByForceMilitary: return forceMil;
|
||||||
case ByVtol: return vtol;
|
case ByVtol: return vtol;
|
||||||
|
case ByCategoryGlider: return categoryGlider;
|
||||||
|
case ByCategoryMilitary: return categoryMilitary;
|
||||||
case ScoreIgnoreZeros: return noZeros;
|
case ScoreIgnoreZeros: return noZeros;
|
||||||
case ScorePreferColorLiveries: return preferColorLiveries;
|
case ScorePreferColorLiveries: return preferColorLiveries;
|
||||||
case ExcludeNoDbData: return exNoDb;
|
case ExcludeNoDbData: return exNoDb;
|
||||||
@@ -178,6 +189,8 @@ namespace BlackMisc
|
|||||||
if (mode.testFlag(ByCombinedType)) { modes << modeFlagToString(ByCombinedType); }
|
if (mode.testFlag(ByCombinedType)) { modes << modeFlagToString(ByCombinedType); }
|
||||||
if (mode.testFlag(ByForceCivilian)) { modes << modeFlagToString(ByForceCivilian); }
|
if (mode.testFlag(ByForceCivilian)) { modes << modeFlagToString(ByForceCivilian); }
|
||||||
if (mode.testFlag(ByForceMilitary)) { modes << modeFlagToString(ByForceMilitary); }
|
if (mode.testFlag(ByForceMilitary)) { modes << modeFlagToString(ByForceMilitary); }
|
||||||
|
if (mode.testFlag(ByCategoryGlider)) { modes << modeFlagToString(ByCategoryGlider); }
|
||||||
|
if (mode.testFlag(ByCategoryMilitary)) { modes << modeFlagToString(ByCategoryMilitary); }
|
||||||
if (mode.testFlag(ByVtol)) { modes << modeFlagToString(ByVtol); }
|
if (mode.testFlag(ByVtol)) { modes << modeFlagToString(ByVtol); }
|
||||||
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); }
|
||||||
@@ -206,9 +219,10 @@ namespace BlackMisc
|
|||||||
return unknown;
|
return unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftMatcherSetup::MatchingMode CAircraftMatcherSetup::matchingMode(bool byModelString, bool byIcaoDataAircraft1st, bool byIcaoDataAirline1st, bool byFamily, bool byLivery, bool byCombinedType,
|
CAircraftMatcherSetup::MatchingMode CAircraftMatcherSetup::matchingMode(
|
||||||
bool byForceMilitary, bool byForceCivilian,
|
bool byModelString, bool byIcaoDataAircraft1st, bool byIcaoDataAirline1st, bool byFamily, bool byLivery, bool byCombinedType,
|
||||||
bool byVtol,
|
bool byForceMilitary, bool byForceCivilian, bool byVtol,
|
||||||
|
bool byGliderCategory, bool byMilitaryCategory,
|
||||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
|
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
|
||||||
bool excludeNoDbData, bool excludeNoExcluded,
|
bool excludeNoDbData, bool excludeNoExcluded,
|
||||||
bool modelVerification, bool modelSetRemoveFailedModel, bool modelFailover)
|
bool modelVerification, bool modelSetRemoveFailedModel, bool modelFailover)
|
||||||
@@ -224,6 +238,8 @@ namespace BlackMisc
|
|||||||
if (byForceMilitary) { mode |= ByForceMilitary; }
|
if (byForceMilitary) { mode |= ByForceMilitary; }
|
||||||
if (byForceCivilian) { mode |= ByForceCivilian; }
|
if (byForceCivilian) { mode |= ByForceCivilian; }
|
||||||
if (byVtol) { mode |= ByVtol; }
|
if (byVtol) { mode |= ByVtol; }
|
||||||
|
if (byGliderCategory) { mode |= ByCategoryGlider; }
|
||||||
|
if (byMilitaryCategory) { mode |= ByCategoryMilitary; }
|
||||||
if (scoreIgnoreZeros) { mode |= ScoreIgnoreZeros; }
|
if (scoreIgnoreZeros) { mode |= ScoreIgnoreZeros; }
|
||||||
if (scorePreferColorLiveries) { mode |= ScorePreferColorLiveries; }
|
if (scorePreferColorLiveries) { mode |= ScorePreferColorLiveries; }
|
||||||
if (excludeNoDbData) { mode |= ExcludeNoDbData; }
|
if (excludeNoDbData) { mode |= ExcludeNoDbData; }
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
MatchingScoreBased,
|
MatchingScoreBased,
|
||||||
MatchingStepwiseReducePlusScoreBased,
|
MatchingStepwiseReducePlusScoreBased,
|
||||||
MatchingStepwiseReduce
|
MatchingStepwiseReduce,
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Enabled matching mode flags
|
//! Enabled matching mode flags
|
||||||
enum MatchingModeFlag
|
enum MatchingModeFlag
|
||||||
{
|
{
|
||||||
ByModelString = 1 << 0, //!< allow exact model string match
|
ByModelString = 1 << 0, //!< allow exact model string match
|
||||||
ByIcaoData = 1 << 1,
|
ByIcaoData = 1 << 1, //!< ICAO airline and aircraft codes
|
||||||
ByFamily = 1 << 2,
|
ByFamily = 1 << 2,
|
||||||
ByLivery = 1 << 3,
|
ByLivery = 1 << 3,
|
||||||
ByCombinedType = 1 << 4,
|
ByCombinedType = 1 << 4,
|
||||||
@@ -46,6 +46,9 @@ namespace BlackMisc
|
|||||||
ByVtol = 1 << 8,
|
ByVtol = 1 << 8,
|
||||||
ByIcaoOrderAircraftFirst = (1 << 9) | ByIcaoData,
|
ByIcaoOrderAircraftFirst = (1 << 9) | ByIcaoData,
|
||||||
ByIcaoOrderAirlineFirst = (1 << 10) | ByIcaoData,
|
ByIcaoOrderAirlineFirst = (1 << 10) | ByIcaoData,
|
||||||
|
ByCategoryGlider = 1 << 20,
|
||||||
|
ByCategoryMilitary = 1 << 21,
|
||||||
|
|
||||||
// --- score based matching ---
|
// --- score based matching ---
|
||||||
ScoreIgnoreZeros = 1 << 11, //!< zero scores are ignored
|
ScoreIgnoreZeros = 1 << 11, //!< zero scores are ignored
|
||||||
ScorePreferColorLiveries = 1 << 12, //!< prefer color liveries
|
ScorePreferColorLiveries = 1 << 12, //!< prefer color liveries
|
||||||
@@ -57,15 +60,18 @@ namespace BlackMisc
|
|||||||
ModelSetRemoveFailedModel = 1 << 15,
|
ModelSetRemoveFailedModel = 1 << 15,
|
||||||
ModelVerificationAtStartup = 1 << 16,
|
ModelVerificationAtStartup = 1 << 16,
|
||||||
ModelFailoverIfNoModelCanBeAdded = 1 << 17,
|
ModelFailoverIfNoModelCanBeAdded = 1 << 17,
|
||||||
|
|
||||||
// --- others ---
|
// --- others ---
|
||||||
ModeNone = 0,
|
ModeNone = 0,
|
||||||
ModeByFLags = ByMilitary | ByVtol,
|
ModeByFLags = ByMilitary | ByVtol,
|
||||||
|
|
||||||
|
// default mode for set handling
|
||||||
ModeDefaultSet = ModelSetRemoveFailedModel | ModelVerificationAtStartup | ModelFailoverIfNoModelCanBeAdded,
|
ModeDefaultSet = ModelSetRemoveFailedModel | ModelVerificationAtStartup | ModelFailoverIfNoModelCanBeAdded,
|
||||||
// ModeDefaultSet = ModelSetRemoveFailedModel | ModelFailoverIfNoModelCanBeAdded,
|
|
||||||
|
// default depending on algorithm
|
||||||
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)
|
||||||
|
|
||||||
@@ -144,6 +150,9 @@ namespace BlackMisc
|
|||||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const BlackMisc::CVariant &variant);
|
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const BlackMisc::CVariant &variant);
|
||||||
|
|
||||||
|
//! Reset
|
||||||
|
void reset();
|
||||||
|
|
||||||
//! Reset
|
//! Reset
|
||||||
void reset(MatchingAlgorithm algorithm);
|
void reset(MatchingAlgorithm algorithm);
|
||||||
|
|
||||||
@@ -163,12 +172,12 @@ namespace BlackMisc
|
|||||||
static MatchingMode matchingMode(bool byModelString, bool byIcaoDataAircraft1st, bool byIcaoDataAirline1st,
|
static MatchingMode matchingMode(bool byModelString, bool byIcaoDataAircraft1st, bool byIcaoDataAirline1st,
|
||||||
bool byFamily, bool byLivery, bool byCombinedType,
|
bool byFamily, bool byLivery, bool byCombinedType,
|
||||||
bool byForceMilitary, bool byForceCivilian,
|
bool byForceMilitary, bool byForceCivilian,
|
||||||
bool byVtol,
|
bool byVtol, bool byGliderCategory, bool byMilitaryCategory,
|
||||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries, bool excludeNoDbData, bool excludeNoExcluded,
|
bool scoreIgnoreZeros, bool scorePreferColorLiveries, bool excludeNoDbData, bool excludeNoExcluded,
|
||||||
bool modelVerification, bool modelSetRemoveFailedModel, bool modelFailover);
|
bool modelVerification, bool modelSetRemoveFailedModel, bool modelFailover);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_algorithm = static_cast<int>(ModeDefault);
|
int m_algorithm = static_cast<int>(MatchingStepwiseReducePlusScoreBased);
|
||||||
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