diff --git a/src/main/lemondronor/circlebot.cljs b/src/main/lemondronor/circlebot.cljs index 84109fb..eb0d565 100644 --- a/src/main/lemondronor/circlebot.cljs +++ b/src/main/lemondronor/circlebot.cljs @@ -187,6 +187,12 @@ (> (:alt ac) 300))) +(defn circling2? [ac config] + (let [relevant-history (filter #(and (:alt %) (> (:alt %) 300)) (:history ac))] + (and (> (geo/flight-curviness relevant-history) (:curviness-threshold-degrees config)) + (> (:alt ac) 300)))) + + ;; Returns a vector of two elements, ;; [updated-database potentially-circling-aircraft] @@ -201,7 +207,7 @@ ac (assoc ac :curviness curviness :normalized-curviness (geo/flight-normalized-curviness (:history ac))) - currently-circling? (circling? ac config) + currently-circling? (circling2? ac config) previously-circling? (:started-circling-time ac)] (cond (and currently-circling?