6 #include "ui_interpolationsetupform.h"
11 using namespace swift::misc::physical_quantities;
12 using namespace swift::misc::simulation;
14 namespace swift::gui::editors
16 CInterpolationSetupForm::CInterpolationSetupForm(QWidget *parent)
20 m_allCheckBoxes = this->findChildren<QCheckBox *>(QString(), Qt::FindDirectChildrenOnly);
21 for (QCheckBox *cb : std::as_const(m_allCheckBoxes))
23 connect(cb, &QCheckBox::stateChanged,
this, &CInterpolationSetupForm::onCheckboxChanged);
27 connect(ui->rb_Linear, &QRadioButton::toggled,
this, &CInterpolationSetupForm::onInterpolatorModeChanged);
30 connect(ui->le_PitchOnGround, &QLineEdit::editingFinished,
this, &CInterpolationSetupForm::onPitchChanged);
69 ui->le_PitchOnGround->setReadOnly(readonly);
71 const bool enabled = !readonly;
72 ui->rb_Linear->setEnabled(enabled);
73 ui->rb_Spline->setEnabled(enabled);
82 void CInterpolationSetupForm::onCheckboxChanged(
int state)
90 if (ui->rb_Linear->isChecked()) {
return CInterpolationAndRenderingSetupBase::Linear; }
91 return CInterpolationAndRenderingSetupBase::Spline;
98 case CInterpolationAndRenderingSetupBase::Linear: ui->rb_Linear->setChecked(
true);
break;
99 case CInterpolationAndRenderingSetupBase::Spline:
100 default: ui->rb_Spline->setChecked(
true);
break;
104 void CInterpolationSetupForm::onInterpolatorModeChanged(
bool checked)
110 void CInterpolationSetupForm::onPitchChanged()
112 const CAngle pitchOnGround = this->getPitchOnGround();
113 this->displayPitchOnGround(pitchOnGround);
116 CAngle CInterpolationSetupForm::getPitchOnGround()
const
119 const QString p = ui->le_PitchOnGround->text().trimmed();
120 pitch.
parseFromString(p, CPqString::SeparatorBestGuess, CAngleUnit::deg());
124 void CInterpolationSetupForm::displayPitchOnGround(
const CAngle &pitchOnGround)
127 ui->le_PitchOnGround->setText(p);
static void checkBoxReadOnly(QCheckBox *checkBox, bool readOnly)
Pseudo readonly state for checkbox.
Status messages, e.g. from Core -> GUI.
Physical unit angle (radians, degrees)
void parseFromString(const QString &value)
Parse value from string.
QString valueRoundedWithUnit(const MU &unit, int digits=-1, bool withGroupSeparator=false, bool i18n=false) const
Value to QString with the given unit, e.g. "5.00m".
Value object for interpolator and rendering base class.
void setFixingSceneryOffset(bool fix)
Enable fix scenery offset if it has been detected.
bool setPitchOnGround(const physical_quantities::CAngle &pitchOnGround)
Force a given pitch on ground.
InterpolatorMode
Interpolator type.
bool setLogInterpolation(bool log)
Log.interpolation.
bool logInterpolation() const
Log.interpolation.
bool isSendingGndFlagToSimulator() const
Send GND flag to simulator.
bool setSendingGndFlagToSimulator(bool sendFLag)
Set sending GND flag to simulator.
bool setEnabledAircraftParts(bool enabled)
Set enabled aircraft parts.
bool setInterpolatorMode(InterpolatorMode mode)
Set interpolator mode.
bool isFixingSceneryOffset() const
Fix scenery offset if it has been detected.
bool isAircraftPartsEnabled() const
Aircraft parts enabled (still requires the other aircraft to send parts)
InterpolatorMode getInterpolatorMode() const
Interpolator mode.
void setForceFullInterpolation(bool force)
Force full interpolation.
void setSimulatorDebuggingMessages(bool debug)
Debugging messages for simulation.
const physical_quantities::CAngle & getPitchOnGround() const
Force a given pitch on ground.
bool showSimulatorDebugMessages() const
Debugging messages for simulation.
bool isForcingFullInterpolation() const
Full interpolation (skip optimizations like checking if aircraft moves etc.)
Value object for interpolator and rendering per callsign.
Free functions in swift::misc.