From f279422d2d4225986ebc594ba6ea524943aba500 Mon Sep 17 00:00:00 2001 From: Herve Date: Wed, 29 Jan 2025 17:58:50 +0100 Subject: [PATCH] Discard updates from pilots above 5000ft and distance > 10nm Todo: Replace hardcoded distance with configurable --- src/core/DataManager.cpp | 11 +++++++++++ src/types/Pilot.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/core/DataManager.cpp b/src/core/DataManager.cpp index 46d1b5f..89cce22 100644 --- a/src/core/DataManager.cpp +++ b/src/core/DataManager.cpp @@ -287,6 +287,14 @@ DataManager::MessageType DataManager::deltaEuroscopeToBackend(const std::array 5000) || (data[EuroscopeData].distanceFromOrigin > 10.0))) { + return DataManager::MessageType::None; + } + if (data[ServerData].callsign == "" && data[EuroscopeData].callsign != "") { return DataManager::MessageType::Post; } else { @@ -516,6 +524,9 @@ types::Pilot DataManager::CFlightPlanToPilot(const EuroScopePlugIn::CFlightPlan // position data pilot.latitude = flightplan.GetFPTrackPosition().GetPosition().m_Latitude; pilot.longitude = flightplan.GetFPTrackPosition().GetPosition().m_Longitude; + pilot.trueAltitude = flightplan.GetFPTrackPosition().GetPressureAltitude(); + pilot.distanceFromOrigin = flightplan.GetDistanceFromOrigin(); + pilot.isSimulated = flightplan.GetSimulated(); // flightplan & clearance data pilot.origin = flightplan.GetFlightPlanData().GetOrigin(); diff --git a/src/types/Pilot.h b/src/types/Pilot.h index 5e9571f..b9bea3f 100644 --- a/src/types/Pilot.h +++ b/src/types/Pilot.h @@ -19,7 +19,12 @@ typedef struct Pilot_t { double latitude = 0.0; double longitude = 0.0; + + double trueAltitude = 0.0; + double distanceFromOrigin = 0.0; + bool taxizoneIsTaxiout = false; + bool isSimulated = false; // flightplan & clearance data