From 4a6a6ace37dd239bd52f6e1fd361fcc09a73b78a Mon Sep 17 00:00:00 2001 From: Stephen D <webmaster@scd31.com> Date: Sun, 31 Mar 2024 09:52:31 -0300 Subject: [PATCH] update readme and formatting --- README.md | 2 +- src/handler.rs | 22 +++++++++++----------- src/term.rs | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index aaf2827..9e5a77a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A utility for high altitude balloon APRS tracking. Connects to either APRS-IS or a local KISS TNC (or both!) and listens for the specified callsign. When heard, prints the following: -- Balloon's latitude, longitude, and altitude +- Balloon's latitude, longitude, altitude, and horizontal/vertical velocities - Distance from ground station to balloon - Angle of attack and bearing (useful for aiming an antenna at the ground station) diff --git a/src/handler.rs b/src/handler.rs index 9a4d734..70aadb3 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -74,9 +74,9 @@ fn handle_position( let dist_kmh = dist_hor * 3600.0 / (next.at - l.at).as_secs_f64() / 1000.0; format!( - "\ -\t climb rate = {alt_ms:.2} m/s -\t h. speed = {dist_kmh:.2} km/h" + " + v. speed = {alt_ms:.2} m/s + h. speed = {dist_kmh:.2} km/h" ) } else { String::new() @@ -88,21 +88,21 @@ fn handle_position( "INFO", format!( "{} at -\t lat = {:.6} -\t lon = {:.6} -\t alt = {:.2} m -\t dist = {:.2} km -\t AoA = {:.2} deg -\tAzimuth Bearing = {:.2} deg -{}", + lat = {:.6} + lon = {:.6} + alt = {:.2} m + dist = {:.2} km{} + aoa = {:.2} deg + bearing = {:.2} deg +", callsign, pos.lat, pos.lon, pos.altitude_meters, dist / 1000.0, + delta_s, station.angle_of_attack(pos), station.bearing(pos), - delta_s ), ); } diff --git a/src/term.rs b/src/term.rs index 9450485..20379d1 100644 --- a/src/term.rs +++ b/src/term.rs @@ -18,7 +18,7 @@ fn print<D: Display>(prefix: &'static str, msg: D) { println!( "{}\t{}", format!( - "{} [{prefix}]", + "{}\n[{prefix}]", chrono::offset::Local::now().format("%d/%m/%Y %I:%M:%S %p") ) .white(), -- GitLab