mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-24 07:55:35 +08:00
Ref T299, interpolation setup pitch on ground parsing
This commit is contained in:
@@ -48,8 +48,8 @@ namespace BlackGui
|
||||
ui->cb_ForceFullInterpolation->setChecked(setup.isForcingFullInterpolation());
|
||||
ui->cb_SendGndFlagToSim->setChecked(setup.isSendingGndFlagToSimulator());
|
||||
ui->cb_FixSceneryOffset->setChecked(setup.isFixingSceneryOffset());
|
||||
ui->le_PitchOnGround->setText(setup.getPitchOnGround().valueRoundedWithUnit(CAngleUnit::deg()));
|
||||
this->setInterpolatorMode(setup.getInterpolatorMode());
|
||||
this->displayPitchOnGround(setup.getPitchOnGround());
|
||||
}
|
||||
|
||||
CInterpolationAndRenderingSetupPerCallsign CInterpolationSetupForm::getValue() const
|
||||
@@ -62,6 +62,7 @@ namespace BlackGui
|
||||
setup.setSimulatorDebuggingMessages(ui->cb_DebugDriver->isChecked());
|
||||
setup.setFixingSceneryOffset(ui->cb_FixSceneryOffset->isChecked());
|
||||
setup.setInterpolatorMode(this->getInterpolatorMode());
|
||||
setup.setPitchOnGround(this->getPitchOnGround());
|
||||
return setup;
|
||||
}
|
||||
|
||||
@@ -73,8 +74,11 @@ namespace BlackGui
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_ForceFullInterpolation, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_SendGndFlagToSim, readonly);
|
||||
CGuiUtility::checkBoxReadOnly(ui->cb_FixSceneryOffset, readonly);
|
||||
ui->rb_Linear->setEnabled(!readonly);
|
||||
ui->rb_Spline->setEnabled(!readonly);
|
||||
ui->le_PitchOnGround->setReadOnly(readonly);
|
||||
|
||||
const bool enabled = !readonly;
|
||||
ui->rb_Linear->setEnabled(enabled);
|
||||
ui->rb_Spline->setEnabled(enabled);
|
||||
}
|
||||
|
||||
CStatusMessageList CInterpolationSetupForm::validate(bool nested) const
|
||||
@@ -115,9 +119,22 @@ namespace BlackGui
|
||||
|
||||
void CInterpolationSetupForm::onPitchChanged()
|
||||
{
|
||||
const QString p = ui->le_PitchOnGround->text().trimmed();
|
||||
const CAngle pitchOnGround = this->getPitchOnGround();
|
||||
this->displayPitchOnGround(pitchOnGround);
|
||||
}
|
||||
|
||||
CAngle CInterpolationSetupForm::getPitchOnGround() const
|
||||
{
|
||||
CAngle pitch;
|
||||
pitch.parseFromString(p);
|
||||
const QString p = ui->le_PitchOnGround->text().trimmed();
|
||||
pitch.parseFromString(p, CPqString::SeparatorsBestGuess);
|
||||
return pitch;
|
||||
}
|
||||
|
||||
void CInterpolationSetupForm::displayPitchOnGround(const CAngle &pitchOnGround)
|
||||
{
|
||||
const QString p = pitchOnGround.valueRoundedWithUnit(CAngleUnit::deg(), 1, true);
|
||||
ui->le_PitchOnGround->setText(p);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "form.h"
|
||||
#include "blackmisc/simulation/interpolationrenderingsetup.h"
|
||||
#include "blackmisc/pq/angle.h"
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
|
||||
#include <QScopedPointer>
|
||||
@@ -65,6 +66,12 @@ namespace BlackGui
|
||||
//! Pitch entry
|
||||
void onPitchChanged();
|
||||
|
||||
//! Pitch on ground
|
||||
BlackMisc::PhysicalQuantities::CAngle getPitchOnGround() const;
|
||||
|
||||
//! Display pitch on ground
|
||||
void displayPitchOnGround(const BlackMisc::PhysicalQuantities::CAngle &pitchOnGround);
|
||||
|
||||
//! Mode from UI
|
||||
BlackMisc::Simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode getInterpolatorMode() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user