mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
Ref T298, split military flag into check for civilian/military
* in military -> only military aircraft? * in civilian -> only civilian aircraft?
This commit is contained in:
@@ -714,9 +714,17 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
// military / civilian
|
// military / civilian
|
||||||
if (mode.testFlag(CAircraftMatcherSetup::ByMilitary))
|
bool milFlagReduced = false;
|
||||||
|
if (mode.testFlag(CAircraftMatcherSetup::ByForceMilitary) && remoteAircraft.isMilitary())
|
||||||
{
|
{
|
||||||
matchedModels = ifPossibleReduceByMilitaryFlag(remoteAircraft, matchedModels, reduced, log);
|
matchedModels = ifPossibleReduceByMilitaryFlag(remoteAircraft, matchedModels, reduced, log);
|
||||||
|
milFlagReduced = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!milFlagReduced && mode.testFlag(CAircraftMatcherSetup::ByForceCivilian) && !remoteAircraft.isMilitary())
|
||||||
|
{
|
||||||
|
matchedModels = ifPossibleReduceByMilitaryFlag(remoteAircraft, matchedModels, reduced, log);
|
||||||
|
milFlagReduced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// combined code
|
// combined code
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ namespace BlackGui
|
|||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByLivery, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ByLivery, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByCombinedCode, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ByCombinedCode, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByVtol, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ByVtol, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByMilitary, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ByForceMilitary, readonly);
|
||||||
|
CGuiUtility::checkBoxReadOnly(ui->cb_ByForceCivilian, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ScoreIgnoreZeros, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ScoreIgnoreZeros, readonly);
|
||||||
CGuiUtility::checkBoxReadOnly(ui->cb_ScorePreferColorLiveries, readonly);
|
CGuiUtility::checkBoxReadOnly(ui->cb_ScorePreferColorLiveries, readonly);
|
||||||
|
|
||||||
@@ -72,7 +73,8 @@ namespace BlackGui
|
|||||||
ui->rb_ByIcaoDataAirline1st->setChecked(mode.testFlag(CAircraftMatcherSetup::ByIcaoOrderAirlineFirst));
|
ui->rb_ByIcaoDataAirline1st->setChecked(mode.testFlag(CAircraftMatcherSetup::ByIcaoOrderAirlineFirst));
|
||||||
ui->cb_ByLivery->setChecked(mode.testFlag(CAircraftMatcherSetup::ByLivery));
|
ui->cb_ByLivery->setChecked(mode.testFlag(CAircraftMatcherSetup::ByLivery));
|
||||||
ui->cb_ByFamily->setChecked(mode.testFlag(CAircraftMatcherSetup::ByFamily));
|
ui->cb_ByFamily->setChecked(mode.testFlag(CAircraftMatcherSetup::ByFamily));
|
||||||
ui->cb_ByMilitary->setChecked(mode.testFlag(CAircraftMatcherSetup::ByMilitary));
|
ui->cb_ByForceMilitary->setChecked(mode.testFlag(CAircraftMatcherSetup::ByForceMilitary));
|
||||||
|
ui->cb_ByForceCivilian->setChecked(mode.testFlag(CAircraftMatcherSetup::ByForceCivilian));
|
||||||
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));
|
||||||
@@ -109,7 +111,9 @@ namespace BlackGui
|
|||||||
ui->rb_ByIcaoDataAircraft1st->isChecked(), ui->rb_ByIcaoDataAirline1st->isChecked(),
|
ui->rb_ByIcaoDataAircraft1st->isChecked(), ui->rb_ByIcaoDataAirline1st->isChecked(),
|
||||||
ui->cb_ByFamily->isChecked(), ui->cb_ByLivery->isChecked(),
|
ui->cb_ByFamily->isChecked(), ui->cb_ByLivery->isChecked(),
|
||||||
ui->cb_ByCombinedCode->isChecked(),
|
ui->cb_ByCombinedCode->isChecked(),
|
||||||
ui->cb_ByMilitary->isChecked(), ui->cb_ByVtol->isChecked(),
|
ui->cb_ByForceMilitary->isChecked(),
|
||||||
|
ui->cb_ByForceCivilian->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()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -105,13 +105,6 @@
|
|||||||
<string>Reduction</string>
|
<string>Reduction</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gl_Mode">
|
<layout class="QGridLayout" name="gl_Mode">
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QCheckBox" name="cb_ByModelString">
|
|
||||||
<property name="text">
|
|
||||||
<string>model string</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QRadioButton" name="rb_ByIcaoDataAirline1st">
|
<widget class="QRadioButton" name="rb_ByIcaoDataAirline1st">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -119,10 +112,17 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="2">
|
<item row="2" column="0">
|
||||||
<widget class="Line" name="line_Reduction">
|
<widget class="QCheckBox" name="cb_ByModelString">
|
||||||
<property name="orientation">
|
<property name="text">
|
||||||
<enum>Qt::Horizontal</enum>
|
<string>model string</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="cb_ByCombinedCode">
|
||||||
|
<property name="text">
|
||||||
|
<string>combined code</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -133,6 +133,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="Line" name="line_Reduction">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QRadioButton" name="rb_ByIcaoDataAircraft1st">
|
<widget class="QRadioButton" name="rb_ByIcaoDataAircraft1st">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -147,27 +154,33 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QCheckBox" name="cb_ByCombinedCode">
|
<widget class="QCheckBox" name="cb_ByForceMilitary">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>inbound military force matched military</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>combined code</string>
|
<string>force military</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1" colspan="2">
|
||||||
<widget class="QCheckBox" name="cb_ByMilitary">
|
|
||||||
<property name="text">
|
|
||||||
<string>military</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="2">
|
|
||||||
<widget class="QCheckBox" name="cb_ByVtol">
|
<widget class="QCheckBox" name="cb_ByVtol">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Vertical Takeoff or Landing</string>
|
<string>Vertical Takeoff or Landing</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>VTOL</string>
|
<string>VTOL (helicopters and such)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QCheckBox" name="cb_ByForceCivilian">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>inbound civilian force matched civilian</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>force civilian</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -231,6 +244,8 @@
|
|||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>rb_Reduction</tabstop>
|
<tabstop>rb_Reduction</tabstop>
|
||||||
<tabstop>rb_ScoreOnly</tabstop>
|
<tabstop>rb_ScoreOnly</tabstop>
|
||||||
|
<tabstop>rb_ScoreAndReduction</tabstop>
|
||||||
|
<tabstop>pb_Reset</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>
|
||||||
@@ -238,6 +253,11 @@
|
|||||||
<tabstop>rb_ByIcaoDataAirline1st</tabstop>
|
<tabstop>rb_ByIcaoDataAirline1st</tabstop>
|
||||||
<tabstop>cb_ByModelString</tabstop>
|
<tabstop>cb_ByModelString</tabstop>
|
||||||
<tabstop>cb_ByLivery</tabstop>
|
<tabstop>cb_ByLivery</tabstop>
|
||||||
|
<tabstop>cb_ByFamily</tabstop>
|
||||||
|
<tabstop>cb_ByCombinedCode</tabstop>
|
||||||
|
<tabstop>cb_ByVtol</tabstop>
|
||||||
|
<tabstop>cb_ByForceMilitary</tabstop>
|
||||||
|
<tabstop>cb_ByForceCivilian</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>
|
||||||
|
|||||||
@@ -125,6 +125,9 @@ namespace BlackMisc
|
|||||||
static const QString icaoAircraft("by ICAO, aircraft first");
|
static const QString icaoAircraft("by ICAO, aircraft first");
|
||||||
static const QString icaoAirline("by ICAO, airline first");
|
static const QString icaoAirline("by ICAO, airline first");
|
||||||
static const QString family("by family");
|
static const QString family("by family");
|
||||||
|
static const QString forceMil("force military");
|
||||||
|
static const QString forceCiv("force civilian");
|
||||||
|
static const QString vtol("VTOL");
|
||||||
static const QString livery("by livery");
|
static const QString livery("by livery");
|
||||||
static const QString combined("by combined code");
|
static const QString combined("by combined code");
|
||||||
static const QString noZeros("scoring, ignore zero scores");
|
static const QString noZeros("scoring, ignore zero scores");
|
||||||
@@ -141,6 +144,9 @@ namespace BlackMisc
|
|||||||
case ByCombinedType: return combined;
|
case ByCombinedType: return combined;
|
||||||
case ByIcaoOrderAircraftFirst: return icaoAircraft;
|
case ByIcaoOrderAircraftFirst: return icaoAircraft;
|
||||||
case ByIcaoOrderAirlineFirst: return icaoAirline;
|
case ByIcaoOrderAirlineFirst: return icaoAirline;
|
||||||
|
case ByForceCivilian: return forceCiv;
|
||||||
|
case ByForceMilitary: return forceMil;
|
||||||
|
case ByVtol: return vtol;
|
||||||
case ScoreIgnoreZeros: return noZeros;
|
case ScoreIgnoreZeros: return noZeros;
|
||||||
case ScorePreferColorLiveries: return preferColorLiveries;
|
case ScorePreferColorLiveries: return preferColorLiveries;
|
||||||
case ExcludeNoDbData: return exNoDb;
|
case ExcludeNoDbData: return exNoDb;
|
||||||
@@ -162,6 +168,9 @@ namespace BlackMisc
|
|||||||
if (mode.testFlag(ByFamily)) { modes << modeFlagToString(ByFamily); }
|
if (mode.testFlag(ByFamily)) { modes << modeFlagToString(ByFamily); }
|
||||||
if (mode.testFlag(ByLivery)) { modes << modeFlagToString(ByLivery); }
|
if (mode.testFlag(ByLivery)) { modes << modeFlagToString(ByLivery); }
|
||||||
if (mode.testFlag(ByCombinedType)) { modes << modeFlagToString(ByCombinedType); }
|
if (mode.testFlag(ByCombinedType)) { modes << modeFlagToString(ByCombinedType); }
|
||||||
|
if (mode.testFlag(ByForceCivilian)) { modes << modeFlagToString(ByForceCivilian); }
|
||||||
|
if (mode.testFlag(ByForceMilitary)) { modes << modeFlagToString(ByForceMilitary); }
|
||||||
|
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); }
|
||||||
return modes.join(", ");
|
return modes.join(", ");
|
||||||
@@ -185,11 +194,11 @@ namespace BlackMisc
|
|||||||
return unknown;
|
return unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftMatcherSetup::MatchingMode CAircraftMatcherSetup::matchingMode(
|
CAircraftMatcherSetup::MatchingMode CAircraftMatcherSetup::matchingMode(bool byModelString, bool byIcaoDataAircraft1st, bool byIcaoDataAirline1st, bool byFamily, bool byLivery, bool byCombinedType,
|
||||||
bool byModelString, bool byIcaoDataAircraft1st, bool byIcaoDataAirline1st, bool byFamily, bool byLivery, bool byCombinedType,
|
bool byForceMilitary, bool byForceCivilian,
|
||||||
bool byMilitary, bool byVtol,
|
bool byVtol,
|
||||||
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
|
bool scoreIgnoreZeros, bool scorePreferColorLiveries,
|
||||||
bool excludeNoDbData, bool excludeNoExcluded)
|
bool excludeNoDbData, bool excludeNoExcluded)
|
||||||
{
|
{
|
||||||
MatchingMode mode = byModelString ? ByModelString : ModeNone;
|
MatchingMode mode = byModelString ? ByModelString : ModeNone;
|
||||||
if (byIcaoDataAircraft1st) { mode |= ByIcaoOrderAircraftFirst; }
|
if (byIcaoDataAircraft1st) { mode |= ByIcaoOrderAircraftFirst; }
|
||||||
@@ -197,7 +206,8 @@ namespace BlackMisc
|
|||||||
if (byFamily) { mode |= ByFamily; }
|
if (byFamily) { mode |= ByFamily; }
|
||||||
if (byLivery) { mode |= ByLivery; }
|
if (byLivery) { mode |= ByLivery; }
|
||||||
if (byCombinedType) { mode |= ByCombinedType; }
|
if (byCombinedType) { mode |= ByCombinedType; }
|
||||||
if (byMilitary) { mode |= ByMilitary; }
|
if (byForceMilitary) { mode |= ByForceMilitary; }
|
||||||
|
if (byForceCivilian) { mode |= ByForceCivilian; }
|
||||||
if (byVtol) { mode |= ByVtol; }
|
if (byVtol) { mode |= ByVtol; }
|
||||||
if (scoreIgnoreZeros) { mode |= ScoreIgnoreZeros; }
|
if (scoreIgnoreZeros) { mode |= ScoreIgnoreZeros; }
|
||||||
if (scorePreferColorLiveries) { mode |= ScorePreferColorLiveries; }
|
if (scorePreferColorLiveries) { mode |= ScorePreferColorLiveries; }
|
||||||
|
|||||||
@@ -41,16 +41,18 @@ namespace BlackMisc
|
|||||||
ByLivery = 1 << 3,
|
ByLivery = 1 << 3,
|
||||||
ByCombinedType = 1 << 4,
|
ByCombinedType = 1 << 4,
|
||||||
ByManufacturer = 1 << 5,
|
ByManufacturer = 1 << 5,
|
||||||
ByMilitary = 1 << 6,
|
ByForceMilitary = 1 << 6, //!< military (in) will only search in military
|
||||||
ByVtol = 1 << 7,
|
ByForceCivilian = 1 << 7, //!< civilian (in) will only search in civilian
|
||||||
ByIcaoOrderAircraftFirst = (1 << 8) | ByIcaoData,
|
ByMilitary = ByForceCivilian | ByForceMilitary,
|
||||||
ByIcaoOrderAirlineFirst = (1 << 9) | ByIcaoData,
|
ByVtol = 1 << 8,
|
||||||
|
ByIcaoOrderAircraftFirst = (1 << 9) | ByIcaoData,
|
||||||
|
ByIcaoOrderAirlineFirst = (1 << 10) | ByIcaoData,
|
||||||
// --- score based matching ---
|
// --- score based matching ---
|
||||||
ScoreIgnoreZeros = 1 << 10, //!< zero scores are ignored
|
ScoreIgnoreZeros = 1 << 11, //!< zero scores are ignored
|
||||||
ScorePreferColorLiveries = 1 << 11, //!< prefer color liveries
|
ScorePreferColorLiveries = 1 << 12, //!< prefer color liveries
|
||||||
// --- exclusion ---
|
// --- exclusion ---
|
||||||
ExcludeNoDbData = 1 << 12,
|
ExcludeNoDbData = 1 << 13,
|
||||||
ExcludeNoExcluded = 1 << 13,
|
ExcludeNoExcluded = 1 << 14,
|
||||||
ExcludeDefault = ExcludeNoExcluded | ExcludeNoDbData,
|
ExcludeDefault = ExcludeNoExcluded | ExcludeNoDbData,
|
||||||
// --- others ---
|
// --- others ---
|
||||||
ModeNone = 0,
|
ModeNone = 0,
|
||||||
@@ -139,7 +141,9 @@ namespace BlackMisc
|
|||||||
|
|
||||||
//! Mode by flags
|
//! Mode by flags
|
||||||
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 byMilitary, bool byVtol,
|
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);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -290,7 +290,12 @@ namespace BlackMisc
|
|||||||
|
|
||||||
bool CSimulatedAircraft::isVtol() const
|
bool CSimulatedAircraft::isVtol() const
|
||||||
{
|
{
|
||||||
return getModel().isVtol();
|
return this->getModel().isVtol();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CSimulatedAircraft::isMilitary() const
|
||||||
|
{
|
||||||
|
return this->getModel().isMilitary();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CSimulatedAircraft::getCombinedIcaoLiveryString(bool networkModel) const
|
QString CSimulatedAircraft::getCombinedIcaoLiveryString(bool networkModel) const
|
||||||
|
|||||||
@@ -345,6 +345,9 @@ namespace BlackMisc
|
|||||||
//! VTOL aircraft?
|
//! VTOL aircraft?
|
||||||
bool isVtol() const;
|
bool isVtol() const;
|
||||||
|
|
||||||
|
//! Is military aircraft
|
||||||
|
bool isMilitary() const;
|
||||||
|
|
||||||
//! Combined ICAO / color string
|
//! Combined ICAO / color string
|
||||||
QString getCombinedIcaoLiveryString(bool networkModel = false) const;
|
QString getCombinedIcaoLiveryString(bool networkModel = false) const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user