From 733ceff368ca69711e22fa1e1636357b242722c6 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Fri, 22 Nov 2024 13:35:44 +0100 Subject: [PATCH] fix: Set correct on ground details Fixes #307 --- src/core/fsd/fsdclient.cpp | 9 ++++++--- src/misc/aviation/ongroundinfo.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/fsd/fsdclient.cpp b/src/core/fsd/fsdclient.cpp index 2e7e38e6a..1084fb78f 100644 --- a/src/core/fsd/fsdclient.cpp +++ b/src/core/fsd/fsdclient.cpp @@ -1215,8 +1215,9 @@ namespace swift::core::fsd CSpeed(dataUpdate.m_groundSpeed, CSpeedUnit::kts())); situation.setPressureAltitude(CAltitude(dataUpdate.m_altitudePressure, CAltitude::MeanSeaLevel, CAltitude::PressureAltitude, CLengthUnit::ft())); + // NotSetGroundDetails because here we do not know if this FSD protocol actually utilizes this flag const COnGroundInfo og(dataUpdate.m_onGround ? COnGroundInfo::OnGround : COnGroundInfo::NotOnGround, - COnGroundInfo::InFromNetwork); + COnGroundInfo::NotSetGroundDetails); situation.setOnGroundInfo(og); // Ref T297, default offset time @@ -1255,8 +1256,9 @@ namespace swift::core::fsd CHeading(data.m_heading, CAngleUnit::deg()), CAngle(-data.m_pitch, CAngleUnit::deg()), CAngle(-data.m_bank, CAngleUnit::deg()), CSpeed(data.m_groundSpeed, CSpeedUnit::kts())); + // NotSetGroundDetails because here we do not know if this FSD protocol actually utilizes this flag const COnGroundInfo og(data.m_onGround ? COnGroundInfo::OnGround : COnGroundInfo::NotOnGround, - COnGroundInfo::InFromNetwork); + COnGroundInfo::NotSetGroundDetails); situation.setOnGroundInfo(og); // Ref T297, default offset time @@ -1756,9 +1758,10 @@ namespace swift::core::fsd CAngle(interimPilotDataUpdate.m_pitch, CAngleUnit::deg()), CAngle(interimPilotDataUpdate.m_bank, CAngleUnit::deg()), CSpeed(interimPilotDataUpdate.m_groundSpeed, CSpeedUnit::kts())); + // NotSetGroundDetails because here we do not know if this FSD protocol actually utilizes this flag const COnGroundInfo og(interimPilotDataUpdate.m_onGround ? COnGroundInfo::OnGround : COnGroundInfo::NotOnGround, - COnGroundInfo::InFromNetwork); + COnGroundInfo::NotSetGroundDetails); situation.setOnGroundInfo(og); // Ref T297, default offset time diff --git a/src/misc/aviation/ongroundinfo.h b/src/misc/aviation/ongroundinfo.h index c76874330..2d9bbf21e 100644 --- a/src/misc/aviation/ongroundinfo.h +++ b/src/misc/aviation/ongroundinfo.h @@ -29,7 +29,7 @@ namespace swift::misc::aviation //! Reliability of on ground information enum OnGroundDetails { - NotSetGroundDetails, + NotSetGroundDetails, //!< not set or unknown if correct (e.g. FSD might or might not use the flag) // interpolated situation OnGroundByInterpolation, //!< strongest for remote aircraft OnGroundByElevationAndCG,