rsadsb / adsb_deku

✈️ Rust ADS-B decoder + tui radar application
MIT License
620 stars 22 forks source link

add `--max-range` argument #147

Closed wcampbell0x2a closed 2 years ago

wcampbell0x2a commented 2 years ago

Instead of being a const value, add a --max-range argument for controlling the max range in km.

A user could look at the coverage screen and get a good idea of what this needs to be set to to remain accurate and reduce parsing and keeping bad coordinates.

CableSynth commented 2 years ago

@wcampbell0x2a thinking of taking this on. Searched for range and found it only in AirplaneCoor. Is that about the correct place?

wcampbell0x2a commented 2 years ago

@wcampbell0x2a thinking of taking this on. Searched for range and found it only in AirplaneCoor. Is that about the correct place?

This is actually referencing MAX_RECEIVER_DISTANCE. This is currently defined as a const. https://github.com/rsadsb/adsb_deku/blob/74b2d10abd02f2cbc5897e9bb9d823f6d43c56ae/rsadsb_common/src/lib.rs#L378

Ideally we would add an opt to control this with a default value of the current const value. https://github.com/rsadsb/adsb_deku/blob/74b2d10abd02f2cbc5897e9bb9d823f6d43c56ae/apps/src/radar/cli.rs#L47

CableSynth commented 2 years ago

How would you like Opts passed down to the Airplane? Inside of action?

wcampbell0x2a commented 2 years ago

How would you like Opts passed down to the Airplane? Inside of action?

I'm sure it can be passed through https://github.com/rsadsb/adsb_deku/blob/74b2d10abd02f2cbc5897e9bb9d823f6d43c56ae/rsadsb_common/src/lib.rs#L116

Which is called from here https://github.com/rsadsb/adsb_deku/blob/74b2d10abd02f2cbc5897e9bb9d823f6d43c56ae/apps/src/radar/radar.rs#L397, which settings.opts.max_range should be usable from here.