From 7b94e221217ba959f177614a059853764ddd154f Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Sat, 14 Aug 2021 15:30:38 +0200 Subject: [PATCH] add some more filters --- src/PlugIn.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/PlugIn.cpp b/src/PlugIn.cpp index 2e608c7..39d91bc 100644 --- a/src/PlugIn.cpp +++ b/src/PlugIn.cpp @@ -90,8 +90,15 @@ void PlugIn::OnRadarTargetPositionUpdate(EuroScopePlugIn::CRadarTarget radarTarg if (nullptr == flightPlan.GetFlightPlanData().GetPlanType() || 'I' != *flightPlan.GetFlightPlanData().GetPlanType()) return; - /* TODO filter by distance to destination */ - /* TODO filter by airborne identifier */ + /* filter by distance to destination */ + double distanceNM = flightPlan.GetDistanceToDestination(); + if (250.0 < distanceNM) + return; + + /* filter by airborne identifier (assume a GS>50kn and a big distance to the origin) */ + if (50 > radarTarget.GetGS() || 10.0 > flightPlan.GetDistanceFromOrigin()) + return; + /* TODO generate protobuf message */ /* TODO send aircraft update */ }