From d3aa1180e7f5ace2a9ea91bff47c0aae7edc85e4 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Tue, 21 Jan 2025 08:18:20 +0000 Subject: [PATCH] make tracks statistics consistent across various settings aircraft not seen for 5 min: new track when seen again --- aircraft.c | 1 - track.c | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aircraft.c b/aircraft.c index 828723ae..733149bb 100644 --- a/aircraft.c +++ b/aircraft.c @@ -160,7 +160,6 @@ struct aircraft *aircraftCreate(uint32_t addr) { // initialize data validity ages //adjustExpire(a, 58); - Modes.stats_current.unique_aircraft++; updateTypeReg(a); diff --git a/track.c b/track.c index 74e29ea7..0b075f53 100644 --- a/track.c +++ b/track.c @@ -1943,6 +1943,9 @@ struct aircraft *trackUpdateFromMessage(struct modesMessage *mm) { // only count the aircraft as "seen" for reliable messages with CRC if (mm->address_reliable) { + if (now - a->seen > 300 * SECONDS) { + Modes.stats_current.unique_aircraft++; + } a->seen = now; }