mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
Adds a Local ADS-B layer fed by your own receivers: a browser WebUSB RTL-SDR (with FM listening) and local 1090/978 MHz decoder feeds (LOCAL_RECEIVER_FEEDS, local and private addresses only). Local aircraft draw in magenta with class, silhouettes, 3D models, trails and a position sanity filter; the click card names the band and input that heard them. Builds on Sameh Khamis's SDR prototype and the initial GEV port by Mazeyar Moeini Feizabadi (#134); the decoder-feed design follows the notes on #57. Closes #57. Co-authored-by: Sameh Khamis <[email protected]> Co-authored-by: Mazeyar Moeini Feizabadi <[email protected]>
22 lines
803 B
JavaScript
22 lines
803 B
JavaScript
/**
|
|
* Names for the server's decoder feeds, shared by the Local ADS-B row status
|
|
* and the Radio card. Pure; no imports, so any surface may use it.
|
|
*/
|
|
|
|
/**
|
|
* Display name of one feed: its band, or its ordinal label ("978 MHz UAT #2")
|
|
* when another configured feed shares the band.
|
|
* @param {object} feed Feed status from the route.
|
|
* @param {object[]} [feeds] Every configured feed.
|
|
* @returns {string}
|
|
*/
|
|
export function localReceiverFeedName(feed, feeds = []) {
|
|
const band = feed?.band;
|
|
if (!band) return feed?.label || 'feed';
|
|
const sharing = feeds.filter((other) => other?.band === band);
|
|
if (sharing.length < 2) return band;
|
|
if (typeof feed.label === 'string' && feed.label.includes('#'))
|
|
return feed.label;
|
|
return `${feed.label || band} #${sharing.indexOf(feed) + 1}`;
|
|
}
|