mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Model matching resolution for airline groups
* UI * setup class
This commit is contained in:
@@ -27,12 +27,18 @@ namespace BlackGui
|
||||
{
|
||||
ui->setupUi(this);
|
||||
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_ScoreOnly, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
|
||||
|
||||
connect(ui->pb_ResetAlgorithm, &QPushButton::released, this, &CMatchingForm::resetByAlgorithm, Qt::QueuedConnection);
|
||||
connect(ui->pb_ResetAll, &QPushButton::released, this, &CMatchingForm::resetAll, Qt::QueuedConnection);
|
||||
connect(ui->pb_MsNetwork, &QPushButton::released, this, &CMatchingForm::fileDialog, Qt::QueuedConnection);
|
||||
connect(ui->pb_MsMatching, &QPushButton::released, this, &CMatchingForm::fileDialog, 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_AirlineGroupIfNoAirline, &QRadioButton::released, this, &CMatchingForm::onAirlineGroupChanged, Qt::QueuedConnection);
|
||||
connect(ui->rb_AirlineGroupAsAirline, &QRadioButton::released, this, &CMatchingForm::onAirlineGroupChanged, Qt::QueuedConnection);
|
||||
connect(ui->rb_AirlineGroupNo, &QRadioButton::released, this, &CMatchingForm::onAirlineGroupChanged, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
CMatchingForm::~CMatchingForm()
|
||||
@@ -62,7 +68,10 @@ namespace BlackGui
|
||||
ui->rb_ScoreOnly->setEnabled(enabled);
|
||||
ui->rb_ByIcaoDataAircraft1st->setEnabled(enabled);
|
||||
ui->rb_ByIcaoDataAirline1st->setEnabled(enabled);
|
||||
ui->rb_PickFirst->setEnabled(enabled);
|
||||
ui->rb_AirlineGroupAsAirline->setEnabled(enabled); ui->rb_PickFirst->setEnabled(enabled);
|
||||
ui->rb_AirlineGroupNo->setEnabled(enabled);
|
||||
ui->rb_AirlineGroupIfNoAirline->setEnabled(enabled);
|
||||
|
||||
ui->rb_PickByOrder->setEnabled(enabled);
|
||||
ui->rb_PickRandom->setEnabled(enabled);
|
||||
|
||||
@@ -83,8 +92,21 @@ namespace BlackGui
|
||||
const CAircraftMatcherSetup::MatchingMode mode = setup.getMatchingMode();
|
||||
ui->cb_ByModelString->setChecked(mode.testFlag(CAircraftMatcherSetup::ByModelString));
|
||||
ui->cb_ByCombinedCode->setChecked(mode.testFlag(CAircraftMatcherSetup::ByCombinedType));
|
||||
|
||||
ui->rb_ByIcaoDataAircraft1st->setChecked(mode.testFlag(CAircraftMatcherSetup::ByIcaoOrderAircraftFirst));
|
||||
ui->rb_ByIcaoDataAirline1st->setChecked(mode.testFlag(CAircraftMatcherSetup::ByIcaoOrderAirlineFirst));
|
||||
|
||||
const bool nag = !mode.testFlag(CAircraftMatcherSetup::ByAirlineGroupSameAsAirline) && !mode.testFlag(CAircraftMatcherSetup::ByAirlineGroupIfNoAirline);
|
||||
if (nag)
|
||||
{
|
||||
ui->rb_AirlineGroupNo->setChecked(nag);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->rb_AirlineGroupAsAirline->setChecked(mode.testFlag(CAircraftMatcherSetup::ByAirlineGroupSameAsAirline));
|
||||
ui->rb_AirlineGroupIfNoAirline->setChecked(mode.testFlag(CAircraftMatcherSetup::CAircraftMatcherSetup::ByAirlineGroupIfNoAirline));
|
||||
}
|
||||
|
||||
ui->cb_ByLivery->setChecked(mode.testFlag(CAircraftMatcherSetup::ByLivery));
|
||||
ui->cb_ByFamily->setChecked(mode.testFlag(CAircraftMatcherSetup::ByFamily));
|
||||
ui->cb_ByForceMilitary->setChecked(mode.testFlag(CAircraftMatcherSetup::ByForceMilitary));
|
||||
@@ -113,6 +135,7 @@ namespace BlackGui
|
||||
CAircraftMatcherSetup CMatchingForm::value() const
|
||||
{
|
||||
CAircraftMatcherSetup setup(algorithm(), matchingMode(), pickStrategy());
|
||||
setup.setAirlineGroupBehaviour(ui->rb_AirlineGroupIfNoAirline->isChecked(), ui->rb_AirlineGroupAsAirline->isChecked());
|
||||
setup.setMsNetworkEntryFile(ui->le_MsNetwork->text());
|
||||
setup.setMsMatchingStageFile(ui->le_MsMatching->text());
|
||||
setup.setMsNetworkEntryEnabled(ui->cb_MsNetwork->isChecked());
|
||||
@@ -228,5 +251,11 @@ namespace BlackGui
|
||||
const CAircraftMatcherSetup setup = this->value();
|
||||
this->setValue(setup);
|
||||
}
|
||||
|
||||
void CMatchingForm::onAirlineGroupChanged()
|
||||
{
|
||||
const CAircraftMatcherSetup setup = this->value();
|
||||
this->setValue(setup);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -66,6 +66,9 @@ namespace BlackGui
|
||||
//! Algorithm has been toggled
|
||||
void onAlgorithmChanged();
|
||||
|
||||
//! Airline group changed
|
||||
void onAirlineGroupChanged();
|
||||
|
||||
//! Reset @{
|
||||
void resetByAlgorithm();
|
||||
void resetAll();
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>293</width>
|
||||
<height>647</height>
|
||||
<width>323</width>
|
||||
<height>667</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -182,34 +182,28 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>150</height>
|
||||
<height>165</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Reduction</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gl_Mode">
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="cb_ByVtol">
|
||||
<property name="toolTip">
|
||||
<string>Vertical Takeoff or Landing</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>VTOL (helicopters and such)</string>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="Line" name="line_Reduction">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="cb_ByForceMilitary">
|
||||
<property name="toolTip">
|
||||
<string>inbound military force matched military</string>
|
||||
</property>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="cb_ByLivery">
|
||||
<property name="text">
|
||||
<string>force military</string>
|
||||
<string> livery</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="cb_ByForceCivilian">
|
||||
<property name="toolTip">
|
||||
<string>inbound civilian force matched civilian</string>
|
||||
@@ -219,46 +213,55 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="cb_ByLivery">
|
||||
<item row="3" column="2">
|
||||
<widget class="QCheckBox" name="cb_ByFamily">
|
||||
<property name="text">
|
||||
<string> livery</string>
|
||||
<string>family</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="cb_ByCombinedCode">
|
||||
<property name="text">
|
||||
<string>combined code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="cb_ByVtol">
|
||||
<property name="toolTip">
|
||||
<string>Vertical Takeoff or Landing</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>VTOL (helicopters and such)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="cb_ByModelString">
|
||||
<property name="text">
|
||||
<string>model string</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="cb_ByForceMilitary">
|
||||
<property name="toolTip">
|
||||
<string>inbound military force matched military</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>force military</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="rb_ByIcaoDataAirline1st">
|
||||
<property name="text">
|
||||
<string>by ICAO: airline first</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="cb_ByCombinedCode">
|
||||
<property name="text">
|
||||
<string>combined code</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QCheckBox" name="cb_ByFamily">
|
||||
<property name="text">
|
||||
<string>family</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="Line" name="line_Reduction">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">bg_ICAOfirst</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
@@ -266,6 +269,39 @@
|
||||
<property name="text">
|
||||
<string>by ICAO: aircraft first</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">bg_ICAOfirst</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="rb_AirlineGroupNo">
|
||||
<property name="text">
|
||||
<string>no airline group</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">bg_AirlineGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QRadioButton" name="rb_AirlineGroupIfNoAirline">
|
||||
<property name="text">
|
||||
<string>group if no airline</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">bg_AirlineGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QRadioButton" name="rb_AirlineGroupAsAirline">
|
||||
<property name="text">
|
||||
<string>group=airline</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">bg_AirlineGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -411,6 +447,9 @@
|
||||
<tabstop>rb_PickByOrder</tabstop>
|
||||
<tabstop>rb_ByIcaoDataAircraft1st</tabstop>
|
||||
<tabstop>rb_ByIcaoDataAirline1st</tabstop>
|
||||
<tabstop>rb_AirlineGroupNo</tabstop>
|
||||
<tabstop>rb_AirlineGroupIfNoAirline</tabstop>
|
||||
<tabstop>rb_AirlineGroupAsAirline</tabstop>
|
||||
<tabstop>cb_ByModelString</tabstop>
|
||||
<tabstop>cb_ByLivery</tabstop>
|
||||
<tabstop>cb_ByFamily</tabstop>
|
||||
@@ -431,4 +470,8 @@
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="bg_AirlineGroup"/>
|
||||
<buttongroup name="bg_ICAOfirst"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user