Ref T261, interpolator mode is now part of setup

* added attribute in setup
* adjusted UI
* adjusted interpolator / simulator functions
This commit is contained in:
Klaus Basan
2018-05-04 22:31:25 +02:00
committed by Roland Winklmeier
parent eb815ab987
commit 3d2a74a652
21 changed files with 175 additions and 270 deletions

View File

@@ -28,6 +28,8 @@ namespace BlackGui
{
connect(cb, &QCheckBox::stateChanged, this, &CInterpolationSetupForm::onCheckboxChanged);
}
connect(ui->co_InterpolatorMode, &QComboBox::currentTextChanged, this, &CInterpolationSetupForm::onInterpolatorModeChanged);
}
CInterpolationSetupForm::~CInterpolationSetupForm()
@@ -41,6 +43,10 @@ namespace BlackGui
ui->cb_ForceFullInterpolation->setChecked(setup.isForcingFullInterpolation());
ui->cb_EnableGndFlag->setChecked(setup.isGndFlagEnabled());
ui->cb_SendGndFlagToSim->setChecked(setup.sendGndFlagToSimulator());
const QString im = setup.getInterpolatorModeAsString();
if (im.contains("linear", Qt::CaseInsensitive)) { ui->co_InterpolatorMode->setCurrentIndex(1); }
else { ui->co_InterpolatorMode->setCurrentIndex(0); }
}
CInterpolationAndRenderingSetupPerCallsign CInterpolationSetupForm::getValue() const
@@ -52,6 +58,7 @@ namespace BlackGui
setup.setLogInterpolation(ui->cb_LogInterpolation->isChecked());
setup.setSendGndFlagToSimulator(ui->cb_SendGndFlagToSim->isChecked());
setup.setSimulatorDebuggingMessages(ui->cb_DebugDriver->isChecked());
setup.setInterpolatorMode(ui->co_InterpolatorMode->currentText());
return setup;
}
@@ -63,6 +70,7 @@ namespace BlackGui
CGuiUtility::checkBoxReadOnly(ui->cb_ForceFullInterpolation, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_EnableGndFlag, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_SendGndFlagToSim, readonly);
ui->co_InterpolatorMode->setEnabled(!readonly);
}
CStatusMessageList CInterpolationSetupForm::validate(bool nested) const
@@ -76,5 +84,11 @@ namespace BlackGui
Q_UNUSED(state);
emit this->valueChanged();
}
void CInterpolationSetupForm::onInterpolatorModeChanged(const QString &mode)
{
Q_UNUSED(mode);
emit this->valueChanged();
}
} // ns
} // ns