mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T298, added algorithm and score values to matching setup
This commit is contained in:
@@ -32,10 +32,17 @@ namespace BlackGui
|
||||
void CMatchingForm::setReadOnly(bool readonly)
|
||||
{
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByModelString, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByICAOdata, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByIcaoDataAircraft1st, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByIcaoDataAirline1st, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByFamily, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByLivery, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ByCombinedCode, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ScoreIgnoreZeros, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ScorePreferColorLiveries, readonly);
|
||||
|
||||
const bool enabled = !readonly;
|
||||
ui->rb_Reduction->setEnabled(enabled);
|
||||
ui->rb_ScoreBased->setEnabled(enabled);
|
||||
}
|
||||
|
||||
CStatusMessageList CMatchingForm::validate(bool withNestedForms) const
|
||||
@@ -49,24 +56,49 @@ 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->cb_ByICAOdata->setChecked(mode.testFlag(CAircraftMatcherSetup::ByIcaoData));
|
||||
ui->cb_ByIcaoDataAircraft1st->setChecked(mode.testFlag(CAircraftMatcherSetup::ByIcaoOrderAircraftFirst));
|
||||
ui->cb_ByIcaoDataAirline1st->setChecked(mode.testFlag(CAircraftMatcherSetup::ByIcaoOrderAirlineFirst));
|
||||
ui->cb_ByLivery->setChecked(mode.testFlag(CAircraftMatcherSetup::ByLivery));
|
||||
ui->cb_ByFamily->setChecked(mode.testFlag(CAircraftMatcherSetup::ByFamily));
|
||||
ui->cb_ScoreIgnoreZeros->setChecked(mode.testFlag(CAircraftMatcherSetup::ScoreIgnoreZeros));
|
||||
ui->cb_ScorePreferColorLiveries->setChecked(mode.testFlag(CAircraftMatcherSetup::ScorePreferColorLiveries));
|
||||
|
||||
if (setup.getMatchingAlgorithm() == CAircraftMatcherSetup::MatchingScoreBased)
|
||||
{
|
||||
ui->rb_ScoreBased->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->rb_Reduction->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
CAircraftMatcherSetup CMatchingForm::value() const
|
||||
{
|
||||
CAircraftMatcherSetup setup;
|
||||
setup.setMatchingMode(matchingMode());
|
||||
const CAircraftMatcherSetup setup(algorithm(), matchingMode());
|
||||
return setup;
|
||||
}
|
||||
|
||||
void CMatchingForm::clear()
|
||||
{
|
||||
CAircraftMatcherSetup s;
|
||||
this->setValue(s);
|
||||
}
|
||||
|
||||
CAircraftMatcherSetup::MatchingAlgorithm CMatchingForm::algorithm() const
|
||||
{
|
||||
if (ui->rb_Reduction->isChecked()) { return CAircraftMatcherSetup::MatchingStepwiseReduce; }
|
||||
return CAircraftMatcherSetup::MatchingScoreBased;
|
||||
}
|
||||
|
||||
CAircraftMatcherSetup::MatchingMode CMatchingForm::matchingMode() const
|
||||
{
|
||||
return CAircraftMatcherSetup::matchingMode(
|
||||
ui->cb_ByModelString->isChecked(), ui->cb_ByICAOdata->isChecked(),
|
||||
ui->cb_ByModelString->isChecked(),
|
||||
ui->cb_ByIcaoDataAircraft1st->isChecked(), ui->cb_ByIcaoDataAirline1st->isChecked(),
|
||||
ui->cb_ByFamily->isChecked(), ui->cb_ByLivery->isChecked(),
|
||||
ui->cb_ByCombinedCode->isChecked()
|
||||
ui->cb_ByCombinedCode->isChecked(),
|
||||
ui->cb_ScoreIgnoreZeros->isChecked(), ui->cb_ScorePreferColorLiveries->isChecked()
|
||||
);
|
||||
}
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user