diff --git a/heliwatch/src/adsb.rs b/heliwatch/src/adsb.rs index 73f020b..c21bc3b 100644 --- a/heliwatch/src/adsb.rs +++ b/heliwatch/src/adsb.rs @@ -6,10 +6,21 @@ use tokio::sync::mpsc::{channel, Receiver}; use super::location::Locations; /// ft -const MAX_ALTITUDE: u16 = 5000; +const MAX_ALTITUDE: u16 = 10_000; /// s const STATE_TIMEOUT: u64 = 180; +const IGNORED_CATEGORIES: &[u8] = &[ + // Small (15,500..75,000) lbs + 2, + // Large (75,000..300,000 lbs) + 3, + // High Vortex Large + 4, + // Heavy (> 300,000 lbs) + 5, +]; + #[derive(Debug, Clone)] pub struct Event { pub action: Action, @@ -122,8 +133,8 @@ pub fn run(host: &'static str, port: u16, locations: Locations) -> Receiver MAX_ALTITUDE) - .unwrap_or(false) + if entry.altitude.map(|altitude| altitude > MAX_ALTITUDE).unwrap_or(false) || + entry.emitter_category.as_ref().map(|category| IGNORED_CATEGORIES.contains(category)).unwrap_or(false) { if !ignored.contains(&hex) { ignored.insert(hex.clone());