refactor: Remove unused sceneryOffset in aircraft situation

This commit is contained in:
Lars Toenning
2024-01-09 21:20:15 +01:00
parent 2cd88fa493
commit e247f20482
4 changed files with 0 additions and 31 deletions

View File

@@ -23,7 +23,6 @@ namespace BlackGui::Models
m_columns.addColumn(CColumn("altitude", CAircraftSituation::IndexAltitude, new CAltitudeFormatter()));
m_columns.addColumn(CColumn("CG", CAircraftSituation::IndexCG, new CPhysiqalQuantiyFormatter<CLengthUnit, CLength>(CLengthUnit::ft(), 1)));
m_columns.addColumn(CColumn("sc.os.", "scenery offset", CAircraftSituation::IndexSceneryOffset, new CPhysiqalQuantiyFormatter<CLengthUnit, CLength>(CLengthUnit::ft(), 1)));
m_columns.addColumn(CColumn("latitude", CAircraftSituation::IndexLatitude, new CLatLonFormatter()));
m_columns.addColumn(CColumn("longitude", CAircraftSituation::IndexLongitude, new CLatLonFormatter()));
m_columns.addColumn(CColumn("gs.", CAircraftSituation::IndexGroundSpeed, new CSpeedKtsFormatter()));

View File

@@ -117,8 +117,6 @@ namespace BlackMisc::Aviation
u"[cor] | og: " % this->getOnGroundInfo().toQString(i18n) %
u" | CG: " %
(m_cg.isNull() ? QStringLiteral("null") : m_cg.valueRoundedWithUnit(CLengthUnit::m(), 1) % u' ' % m_cg.valueRoundedWithUnit(CLengthUnit::ft(), 1)) %
u" | offset: " %
(m_sceneryOffset.isNull() ? QStringLiteral("null") : m_sceneryOffset.valueRoundedWithUnit(CLengthUnit::m(), 1) % u' ' % m_sceneryOffset.valueRoundedWithUnit(CLengthUnit::ft(), 1)) %
u" | skip ng: " % boolToYesNo(this->canLikelySkipNearGroundInterpolation()) %
u" | bank: " % m_bank.toQString(i18n) %
u" | pitch: " % m_pitch.toQString(i18n) %
@@ -270,7 +268,6 @@ namespace BlackMisc::Aviation
case IndexVelocity: return QVariant::fromValue(this->getVelocity());
case IndexBank: return m_bank.propertyByIndex(index.copyFrontRemoved());
case IndexCG: return m_cg.propertyByIndex(index.copyFrontRemoved());
case IndexSceneryOffset: return m_sceneryOffset.propertyByIndex(index.copyFrontRemoved());
case IndexGroundSpeed: return m_groundSpeed.propertyByIndex(index.copyFrontRemoved());
case IndexGroundElevationPlane: return m_groundElevationPlane.propertyByIndex(index.copyFrontRemoved());
case IndexCallsign: return m_correspondingCallsign.propertyByIndex(index.copyFrontRemoved());
@@ -305,7 +302,6 @@ namespace BlackMisc::Aviation
case IndexBank: m_bank.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
case IndexVelocity: m_velocity.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
case IndexCG: m_cg.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
case IndexSceneryOffset: m_sceneryOffset.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
case IndexGroundSpeed: m_groundSpeed.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
case IndexGroundElevationPlane: m_groundElevationPlane.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
case IndexCallsign: m_correspondingCallsign.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
@@ -332,7 +328,6 @@ namespace BlackMisc::Aviation
case IndexPitch: return m_pitch.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getPitch());
case IndexBank: return m_bank.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getBank());
case IndexCG: return m_cg.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCG());
case IndexSceneryOffset: return m_sceneryOffset.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getSceneryOffset());
case IndexGroundSpeed: return m_groundSpeed.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getGroundSpeed());
case IndexGroundElevationPlane:
case IndexGroundElevationPlusInfo:
@@ -415,7 +410,6 @@ namespace BlackMisc::Aviation
m_elvInfo = NoElevationInfo;
m_isElvInfoTransferred = false;
m_cg.setNull();
m_sceneryOffset.setNull();
}
bool CAircraftSituation::isOnGroundFromParts() const
@@ -834,11 +828,6 @@ namespace BlackMisc::Aviation
m_cg = cg.switchedUnit(this->getAltitudeOrDefaultUnit());
}
void CAircraftSituation::setSceneryOffset(const CLength &sceneryOffset)
{
m_sceneryOffset = sceneryOffset.switchedUnit(this->getAltitudeOrDefaultUnit());
}
bool CAircraftSituation::adjustGroundFlag(const CAircraftParts &parts, bool alwaysSetDetails, double timeDeviationFactor, qint64 *differenceMs)
{
Q_ASSERT_X(timeDeviationFactor >= 0 && timeDeviationFactor <= 1.0, Q_FUNC_INFO, "Expect 0..1");

View File

@@ -73,7 +73,6 @@ namespace BlackMisc
IndexGroundElevationPlusInfo,
IndexCallsign,
IndexCG,
IndexSceneryOffset,
IndexCanLikelySkipNearGroundInterpolation
};
@@ -399,12 +398,6 @@ namespace BlackMisc
//! Has CG set?
bool hasCG() const { return !m_cg.isNull(); }
//! Get scenery offset if any
const PhysicalQuantities::CLength &getSceneryOffset() const { return m_sceneryOffset; }
//! Set scenery offset
void setSceneryOffset(const PhysicalQuantities::CLength &sceneryOffset);
//! Set flag indicating this is an interim position update
void setInterimFlag(bool flag) { m_isInterim = flag; }
@@ -501,7 +494,6 @@ namespace BlackMisc
PhysicalQuantities::CAngle m_bank { 0, nullptr };
PhysicalQuantities::CSpeed m_groundSpeed { 0, nullptr };
PhysicalQuantities::CLength m_cg { 0, nullptr };
PhysicalQuantities::CLength m_sceneryOffset { 0, nullptr };
bool m_hasVelocity = false;
CAircraftVelocity m_velocity;
bool m_isInterim = false; //!< interim situation?
@@ -519,7 +511,6 @@ namespace BlackMisc
BLACK_METAMEMBER(bank),
BLACK_METAMEMBER(groundSpeed),
BLACK_METAMEMBER(cg),
BLACK_METAMEMBER(sceneryOffset),
BLACK_METAMEMBER(hasVelocity),
BLACK_METAMEMBER(velocity),
BLACK_METAMEMBER(groundElevationPlane),

View File

@@ -333,16 +333,6 @@ namespace BlackMisc::Simulation
const CAircraftSituationChange change(updatedSituations, situationCorrected.getCG(), aircraftModel.isVtol(), true, true);
this->storeChange(change);
if (change.hasSceneryDeviation())
{
const CLength offset = change.getGuessedSceneryDeviation();
situationCorrected.setSceneryOffset(offset);
QWriteLocker lock(&m_lockSituations);
m_latestSituationByCallsign[cs].setSceneryOffset(offset);
m_situationsByCallsign[cs].front().setSceneryOffset(offset);
}
// situation has been added
emit this->addedAircraftSituation(situationCorrected);