Explorar o código

add some more filters

Sven Czarnian %!s(int64=3) %!d(string=hai) anos
pai
achega
7b94e22121
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  1. 9 2
      src/PlugIn.cpp

+ 9 - 2
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 */
 }