fix: Set correct on ground details

Fixes #307
This commit is contained in:
Lars Toenning
2024-11-22 13:35:44 +01:00
parent 65db4ee9fd
commit 733ceff368
2 changed files with 7 additions and 4 deletions

View File

@@ -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

View File

@@ -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,