Skip to content

Commit

Permalink
traces: don't save more ground positions than intended
Browse files Browse the repository at this point in the history
tones ground position frequency down after
874c84e
unintentionally increased it
  • Loading branch information
wiedehopf committed Jul 17, 2024
1 parent e04f85c commit 6ff799e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions globe_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -2314,14 +2314,9 @@ int traceAdd(struct aircraft *a, struct modesMessage *mm, int64_t now, int stale
max_speed_diff *= 2;
}

if (max_elapsed > 5 * SECONDS) {
if (a->pos_reliable_valid.source == SOURCE_MLAT) {
min_elapsed = 1500;
max_elapsed = imax(max_elapsed / 2, 5 * SECONDS);
}
if (a->pos_reliable_valid.source != SOURCE_MLAT && !trackVState(now, &a->track_valid, &a->pos_reliable_valid)) {
max_elapsed = imax(max_elapsed / 4, 5 * SECONDS);
}
if (max_elapsed > 5 * SECONDS && a->pos_reliable_valid.source == SOURCE_MLAT) {
min_elapsed = 1500;
max_elapsed = imax(max_elapsed / 2, 5 * SECONDS);
}
// some towers on MLAT .... create unnecessary data
// only reduce data produced for configurations with trace interval more than 5 seconds, others migh want EVERY DOT :)
Expand Down Expand Up @@ -2350,6 +2345,10 @@ int traceAdd(struct aircraft *a, struct modesMessage *mm, int64_t now, int stale
}
}

if (max_elapsed > 5 * SECONDS && a->pos_reliable_valid.source != SOURCE_MLAT && track == -1) {
max_elapsed = imax(max_elapsed / 4, 5 * SECONDS);
}

if (a->trace_current_len == 0)
goto save_state;

Expand Down

0 comments on commit 6ff799e

Please sign in to comment.