From fe4fd316884390fa0c9975d51e83761932df7bdd Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 8 Aug 2018 13:58:36 +0200 Subject: [PATCH] Renamed to FullInterpolation (formerly VtolInterpolation) --- .../components/interpolationsetupcomponent.cpp | 10 +++++----- .../components/interpolationsetupcomponent.h | 4 ++-- .../components/interpolationsetupcomponent.ui | 17 +++++++++++++++-- src/blackgui/editors/interpolationsetupform.cpp | 6 +++--- src/blackgui/editors/interpolationsetupform.ui | 7 ++++--- src/blackgui/models/interpolationsetupmodel.cpp | 2 +- .../simulation/interpolationrenderingsetup.cpp | 10 +++++----- .../simulation/interpolationrenderingsetup.h | 12 ++++++------ src/blackmisc/simulation/interpolator.cpp | 2 +- 9 files changed, 42 insertions(+), 28 deletions(-) diff --git a/src/blackgui/components/interpolationsetupcomponent.cpp b/src/blackgui/components/interpolationsetupcomponent.cpp index db3ad24bc..3254937a5 100644 --- a/src/blackgui/components/interpolationsetupcomponent.cpp +++ b/src/blackgui/components/interpolationsetupcomponent.cpp @@ -72,7 +72,7 @@ namespace BlackGui CInterpolationSetupComponent::Mode CInterpolationSetupComponent::getSetupMode() const { - return ui->rb_Callsign->isChecked() ? CInterpolationSetupComponent::PerCallsign : CInterpolationSetupComponent::Global; + return ui->rb_Callsign->isChecked() ? CInterpolationSetupComponent::SetupPerCallsign : CInterpolationSetupComponent::SetupGlobal; } void CInterpolationSetupComponent::onRowDoubleClicked(const QModelIndex &index) @@ -89,7 +89,7 @@ namespace BlackGui { if (!sGui || sGui->isShuttingDown()) { return; } bool enableCallsign = false; - if (this->getSetupMode() == CInterpolationSetupComponent::Global) + if (this->getSetupMode() == CInterpolationSetupComponent::SetupGlobal) { this->setUiValuesFromGlobal(); } @@ -111,7 +111,7 @@ namespace BlackGui { const bool overlay = QObject::sender() == ui->pb_Reload; if (!this->checkPrerequisites(overlay)) { return; } - if (this->getSetupMode() == CInterpolationSetupComponent::Global) + if (this->getSetupMode() == CInterpolationSetupComponent::SetupGlobal) { CInterpolationAndRenderingSetupGlobal gs = sGui->getIContextSimulator()->getInterpolationAndRenderingSetupGlobal(); ui->form_InterpolationSetup->setValue(gs); @@ -130,7 +130,7 @@ namespace BlackGui if (!this->checkPrerequisites(true)) { return; } CInterpolationAndRenderingSetupPerCallsign setup = ui->form_InterpolationSetup->getValue(); CInterpolationAndRenderingSetupGlobal gs = sGui->getIContextSimulator()->getInterpolationAndRenderingSetupGlobal(); - if (this->getSetupMode() == CInterpolationSetupComponent::Global) + if (this->getSetupMode() == CInterpolationSetupComponent::SetupGlobal) { gs.setBaseValues(setup); gs.setLogInterpolation(false); // that would globally log all values @@ -175,7 +175,7 @@ namespace BlackGui void CInterpolationSetupComponent::removeSetup() { if (!this->checkPrerequisites(true)) { return; } - if (this->getSetupMode() == CInterpolationSetupComponent::Global) { return; } + if (this->getSetupMode() == CInterpolationSetupComponent::SetupGlobal) { return; } const CCallsign cs = ui->comp_CallsignCompleter->getCallsign(false); CInterpolationSetupList setups = ui->tvp_InterpolationSetup->container(); const int removed = setups.removeByCallsign(cs); diff --git a/src/blackgui/components/interpolationsetupcomponent.h b/src/blackgui/components/interpolationsetupcomponent.h index 57bd384b4..9e057e1be 100644 --- a/src/blackgui/components/interpolationsetupcomponent.h +++ b/src/blackgui/components/interpolationsetupcomponent.h @@ -32,8 +32,8 @@ namespace BlackGui //! Mode of setup enum Mode { - Global, - PerCallsign + SetupGlobal, + SetupPerCallsign }; //! Constructor diff --git a/src/blackgui/components/interpolationsetupcomponent.ui b/src/blackgui/components/interpolationsetupcomponent.ui index c65ead7f3..93c44835b 100644 --- a/src/blackgui/components/interpolationsetupcomponent.ui +++ b/src/blackgui/components/interpolationsetupcomponent.ui @@ -100,16 +100,29 @@ - + 0 - 100 + 110 + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/src/blackgui/editors/interpolationsetupform.cpp b/src/blackgui/editors/interpolationsetupform.cpp index 1faca7f40..d9f4f58e2 100644 --- a/src/blackgui/editors/interpolationsetupform.cpp +++ b/src/blackgui/editors/interpolationsetupform.cpp @@ -45,7 +45,7 @@ namespace BlackGui ui->cb_DebugDriver->setChecked(setup.showSimulatorDebugMessages()); ui->cb_LogInterpolation->setChecked(setup.logInterpolation()); ui->cb_EnableParts->setChecked(setup.isAircraftPartsEnabled()); - ui->cb_ForceVtolInterpolation->setChecked(setup.isForcingVtolInterpolation()); + 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())); @@ -56,7 +56,7 @@ namespace BlackGui { CInterpolationAndRenderingSetupPerCallsign setup; setup.setEnabledAircraftParts(ui->cb_EnableParts->isChecked()); - setup.setForceVtolInterpolation(ui->cb_ForceVtolInterpolation->isChecked()); + setup.setForceFullInterpolation(ui->cb_ForceFullInterpolation->isChecked()); setup.setLogInterpolation(ui->cb_LogInterpolation->isChecked()); setup.setSendingGndFlagToSimulator(ui->cb_SendGndFlagToSim->isChecked()); setup.setSimulatorDebuggingMessages(ui->cb_DebugDriver->isChecked()); @@ -70,7 +70,7 @@ namespace BlackGui CGuiUtility::checkBoxReadOnly(ui->cb_DebugDriver, readonly); CGuiUtility::checkBoxReadOnly(ui->cb_LogInterpolation, readonly); CGuiUtility::checkBoxReadOnly(ui->cb_EnableParts, readonly); - CGuiUtility::checkBoxReadOnly(ui->cb_ForceVtolInterpolation, readonly); + CGuiUtility::checkBoxReadOnly(ui->cb_ForceFullInterpolation, readonly); CGuiUtility::checkBoxReadOnly(ui->cb_SendGndFlagToSim, readonly); CGuiUtility::checkBoxReadOnly(ui->cb_FixSceneryOffset, readonly); ui->rb_Linear->setEnabled(!readonly); diff --git a/src/blackgui/editors/interpolationsetupform.ui b/src/blackgui/editors/interpolationsetupform.ui index f3172f125..7cdc371d7 100644 --- a/src/blackgui/editors/interpolationsetupform.ui +++ b/src/blackgui/editors/interpolationsetupform.ui @@ -51,9 +51,9 @@ - + - force VTOL interpolation + force full interpolation @@ -168,10 +168,11 @@ rb_Spline rb_Linear + le_PitchOnGround cb_EnableParts cb_SendGndFlagToSim cb_FixSceneryOffset - cb_ForceVtolInterpolation + cb_ForceFullInterpolation cb_LogInterpolation cb_DebugDriver diff --git a/src/blackgui/models/interpolationsetupmodel.cpp b/src/blackgui/models/interpolationsetupmodel.cpp index 04438ba3d..a02abb49a 100644 --- a/src/blackgui/models/interpolationsetupmodel.cpp +++ b/src/blackgui/models/interpolationsetupmodel.cpp @@ -29,7 +29,7 @@ namespace BlackGui m_columns.addColumn(CColumn("parts", "aircraft parts", CInterpolationAndRenderingSetupPerCallsign::IndexEnabledAircraftParts, new CBoolIconFormatter("parts", "aircraft parts"))); m_columns.addColumn(CColumn("send gnd.", "send gnd.", CInterpolationAndRenderingSetupPerCallsign::IndexSendGndFlagToSimulator, new CBoolIconFormatter("send gnd.", "send gnd."))); m_columns.addColumn(CColumn("sc.os.", "fix scenery offset", CInterpolationAndRenderingSetupPerCallsign::IndexFixSceneryOffset, new CBoolIconFormatter("sc.os.", "fix scenery offset"))); - m_columns.addColumn(CColumn("VTOL", "VTOL interpolstion", CInterpolationAndRenderingSetupPerCallsign::IndexForceVtolInterpolation, new CBoolIconFormatter("VTOL", "VTOL interpolation"))); + m_columns.addColumn(CColumn("full int.", "full interpolation", CInterpolationAndRenderingSetupPerCallsign::IndexForceFullInterpolation, new CBoolIconFormatter("full int.", "full interpolation"))); m_columns.addColumn(CColumn("sim.dbg.", "simulator debug", CInterpolationAndRenderingSetupPerCallsign::IndexSimulatorDebugMessages, new CBoolIconFormatter("sim.dbg.", "simulator debug"))); m_columns.addColumn(CColumn("log.int.", "log.interpolation", CInterpolationAndRenderingSetupPerCallsign::IndexLogInterpolation, new CBoolIconFormatter("log.int.", "log.interpolation"))); // default sort order diff --git a/src/blackmisc/simulation/interpolationrenderingsetup.cpp b/src/blackmisc/simulation/interpolationrenderingsetup.cpp index 9487cd52e..c84b978fe 100644 --- a/src/blackmisc/simulation/interpolationrenderingsetup.cpp +++ b/src/blackmisc/simulation/interpolationrenderingsetup.cpp @@ -102,7 +102,7 @@ namespace BlackMisc { case IndexLogInterpolation: return CVariant::fromValue(m_logInterpolation); case IndexSimulatorDebugMessages: return CVariant::fromValue(m_simulatorDebugMessages); - case IndexForceVtolInterpolation: return CVariant::fromValue(m_forceVtolInterpolation); + case IndexForceFullInterpolation: return CVariant::fromValue(m_forceFullInterpolation); case IndexEnabledAircraftParts: return CVariant::fromValue(m_enabledAircraftParts); case IndexSendGndFlagToSimulator: return CVariant::fromValue(m_sendGndToSim); case IndexInterpolatorMode: return CVariant::fromValue(m_interpolatorMode); @@ -122,7 +122,7 @@ namespace BlackMisc { case IndexLogInterpolation: m_logInterpolation = variant.toBool(); return; case IndexSimulatorDebugMessages: m_simulatorDebugMessages = variant.toBool(); return; - case IndexForceVtolInterpolation: m_forceVtolInterpolation = variant.toBool(); return; + case IndexForceFullInterpolation: m_forceFullInterpolation = variant.toBool(); return; case IndexEnabledAircraftParts: m_enabledAircraftParts = variant.toBool(); return; case IndexSendGndFlagToSimulator: m_sendGndToSim = variant.toBool(); return; case IndexInterpolatorMode: m_interpolatorMode = variant.toInt(); return; @@ -141,7 +141,7 @@ namespace BlackMisc QStringLiteral("Interpolator: ") % this->getInterpolatorModeAsString() % QStringLiteral(" | Dbg.sim.msgs: ") % boolToYesNo(m_simulatorDebugMessages) % QStringLiteral(" | log interpolation: ") % boolToYesNo(m_logInterpolation) % - QStringLiteral(" | force VTOL interpolation: ") % boolToYesNo(m_forceVtolInterpolation) % + QStringLiteral(" | force VTOL interpolation: ") % boolToYesNo(m_forceFullInterpolation) % QStringLiteral(" | enable parts: ") % boolToYesNo(m_enabledAircraftParts) % QStringLiteral(" | send gnd: ") % boolToYesNo(m_sendGndToSim) % QStringLiteral(" | fix.scenery offset: ") % boolToYesNo(m_fixSceneryOffset) % @@ -266,7 +266,7 @@ namespace BlackMisc { m_logInterpolation = baseValues.logInterpolation(); m_simulatorDebugMessages = baseValues.showSimulatorDebugMessages(); - m_forceVtolInterpolation = baseValues.isForcingVtolInterpolation(); + m_forceFullInterpolation = baseValues.isForcingFullInterpolation(); m_enabledAircraftParts = baseValues.isAircraftPartsEnabled(); m_sendGndToSim = baseValues.isSendingGndFlagToSimulator(); m_fixSceneryOffset = baseValues.isFixingSceneryOffset(); @@ -330,7 +330,7 @@ namespace BlackMisc CPropertyIndexList diff; if (this->logInterpolation() != globalSetup.logInterpolation()) { diff.push_back(IndexLogInterpolation); } if (this->showSimulatorDebugMessages() != globalSetup.showSimulatorDebugMessages()) { diff.push_back(IndexSimulatorDebugMessages); } - if (this->isForcingVtolInterpolation() != globalSetup.isForcingVtolInterpolation()) { diff.push_back(IndexForceVtolInterpolation); } + if (this->isForcingFullInterpolation() != globalSetup.isForcingFullInterpolation()) { diff.push_back(IndexForceFullInterpolation); } if (this->isAircraftPartsEnabled() != globalSetup.isAircraftPartsEnabled()) { diff.push_back(IndexEnabledAircraftParts); } if (this->isSendingGndFlagToSimulator() != globalSetup.isSendingGndFlagToSimulator()) { diff.push_back(IndexSendGndFlagToSimulator); } if (this->isFixingSceneryOffset() != globalSetup.isFixingSceneryOffset()) { diff.push_back(IndexFixSceneryOffset); } diff --git a/src/blackmisc/simulation/interpolationrenderingsetup.h b/src/blackmisc/simulation/interpolationrenderingsetup.h index 07f9a20c2..0157ccde8 100644 --- a/src/blackmisc/simulation/interpolationrenderingsetup.h +++ b/src/blackmisc/simulation/interpolationrenderingsetup.h @@ -34,7 +34,7 @@ namespace BlackMisc { IndexLogInterpolation = CPropertyIndex::GlobalIndexCInterpolatioRenderingSetup, IndexSimulatorDebugMessages, - IndexForceVtolInterpolation, + IndexForceFullInterpolation, IndexSendGndFlagToSimulator, IndexEnabledAircraftParts, IndexInterpolatorMode, @@ -63,10 +63,10 @@ namespace BlackMisc bool setLogInterpolation(bool log); //! Full interpolation (skip optimizations like checking if aircraft moves etc.) - bool isForcingVtolInterpolation() const { return m_forceVtolInterpolation; } + bool isForcingFullInterpolation() const { return m_forceFullInterpolation; } //! Force full interpolation - void setForceVtolInterpolation(bool force) { m_forceVtolInterpolation = force; } + void setForceFullInterpolation(bool force) { m_forceFullInterpolation = force; } //! Set enabled aircraft parts bool setEnabledAircraftParts(bool enabled); @@ -131,7 +131,7 @@ namespace BlackMisc bool m_logInterpolation = false; //!< Debug messages in interpolator bool m_simulatorDebugMessages = false; //!< Debug messages of simulator (aka plugin) - bool m_forceVtolInterpolation = false; //!< always do a full interpolation, even if aircraft is not moving + bool m_forceFullInterpolation = false; //!< always do a full interpolation, even if aircraft is not moving bool m_enabledAircraftParts = true; //!< Enable aircraft parts bool m_sendGndToSim = true; //!< Send the gnd.flag to simulator bool m_fixSceneryOffset = false; //!< Fix. scenery offset @@ -214,7 +214,7 @@ namespace BlackMisc CInterpolationAndRenderingSetupGlobal, BLACK_METAMEMBER(logInterpolation), BLACK_METAMEMBER(simulatorDebugMessages), - BLACK_METAMEMBER(forceVtolInterpolation), + BLACK_METAMEMBER(forceFullInterpolation), BLACK_METAMEMBER(sendGndToSim), BLACK_METAMEMBER(enabledAircraftParts), BLACK_METAMEMBER(fixSceneryOffset), @@ -273,7 +273,7 @@ namespace BlackMisc CInterpolationAndRenderingSetupPerCallsign, BLACK_METAMEMBER(logInterpolation), BLACK_METAMEMBER(simulatorDebugMessages), - BLACK_METAMEMBER(forceVtolInterpolation), + BLACK_METAMEMBER(forceFullInterpolation), BLACK_METAMEMBER(sendGndToSim), BLACK_METAMEMBER(enabledAircraftParts), BLACK_METAMEMBER(fixSceneryOffset), diff --git a/src/blackmisc/simulation/interpolator.cpp b/src/blackmisc/simulation/interpolator.cpp index 09bb52db7..da4f46e39 100644 --- a/src/blackmisc/simulation/interpolator.cpp +++ b/src/blackmisc/simulation/interpolator.cpp @@ -74,7 +74,7 @@ namespace BlackMisc template CAircraftSituationList CInterpolator::remoteAircraftSituationsAndChange(const CInterpolationAndRenderingSetupPerCallsign &setup) { - // const bool vtol = setup.isForcingVtolInterpolation() || m_model.isVtol(); + // const bool vtol = setup.isForcingFullInterpolation() || m_model.isVtol(); CAircraftSituationList validSituations = this->remoteAircraftSituations(m_callsign); // get the changes, we need the second value as we want to look in the past