Skip to content

Commit

Permalink
beast-reduce-optimize-for-mlat
Browse files Browse the repository at this point in the history
BeastReduce output: keep all messages relevant to mlat-client
  • Loading branch information
wiedehopf committed May 29, 2024
1 parent 21353a0 commit a833577
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions help.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ static struct argp_option optionsReadsb[] = {
{"tar1090-use-api", OptTar1090UseApi, 0, 0, "when running with globe-index, signal tar1090 use the readsb API to get data, requires webserver mapping of /tar1090/re-api to proxy_pass the requests to the --net-api-port, see nginx-readsb-api.conf in the tar1090 repository for details", 2},
{"net-beast-reduce-out-port", OptNetBeastReducePorts, "<ports>", 0, "TCP BeastReduce output listen ports (default: 0)", 2},
{"net-beast-reduce-interval", OptNetBeastReduceInterval, "<seconds>", 0, "BeastReduce data update interval, longer means less data (default: 0.250, valid range: 0.000 - 14.999)", 2},
{"net-beast-reduce-optimize-for-mlat", OptNetBeastReduceOptimizeMlat, 0, 0, "BeastReduce output: keep all messages relevant to mlat-client", 2},
{"net-beast-reduce-filter-dist", OptNetBeastReduceFilterDist, "<distance in nmi>", 0, "beast-reduce: remove aircraft which are further than distance from the receiver", 2},
{"net-beast-reduce-filter-alt", OptNetBeastReduceFilterAlt, "<pressure altitude in ft>", 0, "beast-reduce: remove aircraft which are above altitude", 2},
{"net-sbs-reduce", OptNetSbsReduce, 0, 0, "Apply beast reduce logic and interval to SBS outputs", 2},
Expand Down
3 changes: 3 additions & 0 deletions readsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
if (atof(arg) > 0)
Modes.beast_reduce_filter_distance = (float) atof(arg) * 1852.0f; // convert to meters
break;
case OptNetBeastReduceOptimizeMlat:
Modes.beast_reduce_optimize_mlat = 1;
break;
case OptNetBeastReduceInterval:
if (atof(arg) >= 0)
Modes.net_output_beast_reduce_interval = (int64_t) (1000 * atof(arg));
Expand Down
2 changes: 2 additions & 0 deletions readsb.h
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ struct _Modes
int8_t viewadsb;
int8_t sbsReduce; // apply beast reduce logic to SBS messages
int8_t asterixReduce; // apply beast reduce logic to SBS messages
int8_t beast_reduce_optimize_mlat; // keep all messages relevant to mlat-client (best-effort)

int position_persistence; // Maximum number of consecutive implausible positions from global CPR to invalidate a known position
int json_reliable;
Expand Down Expand Up @@ -1217,6 +1218,7 @@ enum {
OptNetAsterixReduce,
OptNetBeastReducePorts,
OptNetBeastReduceInterval,
OptNetBeastReduceOptimizeMlat,
OptNetBeastReduceFilterAlt,
OptNetBeastReduceFilterDist,
OptNetSbsReduce,
Expand Down
5 changes: 5 additions & 0 deletions track.c
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,11 @@ struct aircraft *trackUpdateFromMessage(struct modesMessage *mm) {
}


if (Modes.beast_reduce_optimize_mlat) {
if (mm->cpr_valid || a->position_valid.source < SOURCE_ADSR) {
mm->reduce_forward = 1;
}
}

if (mm->acas_ra_valid) {

Expand Down

0 comments on commit a833577

Please sign in to comment.