Set GDL90 traffic alert bit always when bearing/distance is not available. #580, #582.

pull/610/head
Christopher Young 2017-05-17 15:25:14 -04:00
rodzic 83f0c6843f
commit 0d146d1747
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -259,6 +259,10 @@ func registerTrafficUpdate(ti TrafficInfo) {
func isTrafficAlertable(ti TrafficInfo) bool {
// Set alert bit if possible and traffic is within some threshold
// TODO: Could be more intelligent, taking into account headings etc.
if !ti.BearingDist_valid {
// If not able to calculate the distance to the target, let the alert bit be set always.
return true
}
if ti.BearingDist_valid &&
ti.Distance < 3704 { // 3704 meters, 2 nm.
return true