Overhaul mode A/C matching to be much cheaper.
The old matching process which tracked mode A values as pseudo-aircraft got very, very expensive with a large number of mode A/C messages (and with lots of single-bit errors, which seems common with a Beast doing the reception) Instead just count A/C messages directly into a 4096-entry array (which is very fast) and periodically scan the mode S aircraft list to see if we can match anything up (which is fixed overhead + cost proportional to the number of mode S aircraft)
This commit is contained in:
parent
60f1f3bcb6
commit
25ea6d398b
6 changed files with 111 additions and 140 deletions
8
net_io.c
8
net_io.c
|
|
@ -710,7 +710,7 @@ static void send_sbs_heartbeat(struct net_service *service)
|
|||
void modesQueueOutput(struct modesMessage *mm, struct aircraft *a) {
|
||||
int is_mlat = (mm->source == SOURCE_MLAT);
|
||||
|
||||
if (!is_mlat && mm->correctedbits < 2) {
|
||||
if (a && !is_mlat && mm->correctedbits < 2) {
|
||||
// Don't ever forward 2-bit-corrected messages via SBS output.
|
||||
// Don't ever forward mlat messages via SBS output.
|
||||
modesSendSBSOutput(mm, a);
|
||||
|
|
@ -728,7 +728,7 @@ void modesQueueOutput(struct modesMessage *mm, struct aircraft *a) {
|
|||
modesSendBeastOutput(mm);
|
||||
}
|
||||
|
||||
if (!is_mlat) {
|
||||
if (a && !is_mlat) {
|
||||
writeFATSVEvent(mm, a);
|
||||
}
|
||||
}
|
||||
|
|
@ -1027,10 +1027,6 @@ char *generateAircraftJson(const char *url_path, int *len) {
|
|||
Modes.stats_current.messages_total + Modes.stats_alltime.messages_total);
|
||||
|
||||
for (a = Modes.aircrafts; a; a = a->next) {
|
||||
if (a->modeACflags & MODEAC_MSG_FLAG) { // skip any fudged ICAO records Mode A/C
|
||||
continue;
|
||||
}
|
||||
|
||||
if (a->messages < 2) { // basic filter for bad decodes
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue