From 65b2065be4b9b4c767b4d49e772349d4d870468e Mon Sep 17 00:00:00 2001 From: core Date: Wed, 14 Jun 2023 23:20:51 -0400 Subject: [PATCH] less giant progress strips --- src/fps.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/fps.rs b/src/fps.rs index 467e14f..b50c73c 100644 --- a/src/fps.rs +++ b/src/fps.rs @@ -36,12 +36,12 @@ pub fn print_fps(fp: &VatlinkDataV3FlightPlan, callsign: &str) { let arrival = fp.arrival.clone(); let alternate = fp.alternate.clone(); - let main_wrap = 108; + let main_wrap = 78; let mut route = fp.route.clone(); - if fp.route.len() > 108 * 3 { - route = route[..108*3-3].to_string() + "..."; + if fp.route.len() > 78 * 3 { + route = route[..78*3-3].to_string() + "..."; } let route_chars: Vec = route.chars().collect(); @@ -54,16 +54,16 @@ pub fn print_fps(fp: &VatlinkDataV3FlightPlan, callsign: &str) { let mut rem = fp.remarks.clone(); - let room_for_remarks = if fp.route.len() < 108 { + let room_for_remarks = if fp.route.len() < 78 { 4 - } else if fp.route.len() < 108 * 2 { + } else if fp.route.len() < 78 * 2 { 3 } else { 2 }; - if fp.remarks.len() > 108 * room_for_remarks { - rem = rem[..108*room_for_remarks-3].to_string() + "..."; + if fp.remarks.len() > 78 * room_for_remarks { + rem = rem[..78*room_for_remarks-3].to_string() + "..."; } let rem_chars: Vec = rem.chars().collect(); @@ -108,12 +108,12 @@ pub fn print_fps(fp: &VatlinkDataV3FlightPlan, callsign: &str) { } println!("--- FLIGHT PROGRESS STRIP READOUT FOR {} ---", callsign); - println!("┌{:─>leftmost_with_padding$}┬{:─>tnd_leftmost_with_padding$}┬──────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────┬──────┬──────┐", "", ""); + println!("┌{:─>leftmost_with_padding$}┬{:─>tnd_leftmost_with_padding$}┬──────┬────────────────────────────────────────────────────────────────────────────────┬──────┬──────┬──────┐", "", ""); println!("│ {: >longest_block_leftmost$} │ {: >longest_block_2nd_leftmost$} │ {: >4} │ {: leftmost_with_padding$}├{:─>tnd_leftmost_with_padding$}┤ {: >4} │ {: longest_block_leftmost$} │ {: >longest_block_2nd_leftmost$} │ {: >4} │ {: leftmost_with_padding$}├{:─>tnd_leftmost_with_padding$}┤ │ {: 3}{: >ft_offset$} │ {: >longest_block_2nd_leftmost$} │ │ {: leftmost_with_padding$}┴{:─>tnd_leftmost_with_padding$}┴──────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────┴──────┴──────┘", "", ""); + println!("└{:─>leftmost_with_padding$}┴{:─>tnd_leftmost_with_padding$}┴──────┴────────────────────────────────────────────────────────────────────────────────┴──────┴──────┴──────┘", "", ""); println!("--- END FLIGHT PROGRESS STRIP READOUT FOR {} ---", callsign); } \ No newline at end of file