less giant progress strips
This commit is contained in:
parent
3a957e597b
commit
65b2065be4
18
src/fps.rs
18
src/fps.rs
|
@ -36,12 +36,12 @@ pub fn print_fps(fp: &VatlinkDataV3FlightPlan, callsign: &str) {
|
||||||
let arrival = fp.arrival.clone();
|
let arrival = fp.arrival.clone();
|
||||||
let alternate = fp.alternate.clone();
|
let alternate = fp.alternate.clone();
|
||||||
|
|
||||||
let main_wrap = 108;
|
let main_wrap = 78;
|
||||||
|
|
||||||
let mut route = fp.route.clone();
|
let mut route = fp.route.clone();
|
||||||
|
|
||||||
if fp.route.len() > 108 * 3 {
|
if fp.route.len() > 78 * 3 {
|
||||||
route = route[..108*3-3].to_string() + "...";
|
route = route[..78*3-3].to_string() + "...";
|
||||||
}
|
}
|
||||||
|
|
||||||
let route_chars: Vec<char> = route.chars().collect();
|
let route_chars: Vec<char> = route.chars().collect();
|
||||||
|
@ -54,16 +54,16 @@ pub fn print_fps(fp: &VatlinkDataV3FlightPlan, callsign: &str) {
|
||||||
|
|
||||||
let mut rem = fp.remarks.clone();
|
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
|
4
|
||||||
} else if fp.route.len() < 108 * 2 {
|
} else if fp.route.len() < 78 * 2 {
|
||||||
3
|
3
|
||||||
} else {
|
} else {
|
||||||
2
|
2
|
||||||
};
|
};
|
||||||
|
|
||||||
if fp.remarks.len() > 108 * room_for_remarks {
|
if fp.remarks.len() > 78 * room_for_remarks {
|
||||||
rem = rem[..108*room_for_remarks-3].to_string() + "...";
|
rem = rem[..78*room_for_remarks-3].to_string() + "...";
|
||||||
}
|
}
|
||||||
|
|
||||||
let rem_chars: Vec<char> = rem.chars().collect();
|
let rem_chars: Vec<char> = rem.chars().collect();
|
||||||
|
@ -108,12 +108,12 @@ pub fn print_fps(fp: &VatlinkDataV3FlightPlan, callsign: &str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("--- FLIGHT PROGRESS STRIP READOUT FOR {} ---", callsign);
|
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} │ {: <main_wrap$} │ │ │ │", callsign, squawk, departure, route_split[0]);
|
println!("│ {: >longest_block_leftmost$} │ {: >longest_block_2nd_leftmost$} │ {: >4} │ {: <main_wrap$} │ │ │ │", callsign, squawk, departure, route_split[0]);
|
||||||
println!("│{: >leftmost_with_padding$}├{:─>tnd_leftmost_with_padding$}┤ {: >4} │ {: <main_wrap$} │──────┼──────┼──────┤", "", "", arrival, route_split[1].to_string()+rem_01.as_str());
|
println!("│{: >leftmost_with_padding$}├{:─>tnd_leftmost_with_padding$}┤ {: >4} │ {: <main_wrap$} │──────┼──────┼──────┤", "", "", arrival, route_split[1].to_string()+rem_01.as_str());
|
||||||
println!("│ {: >longest_block_leftmost$} │ {: >longest_block_2nd_leftmost$} │ {: >4} │ {: <main_wrap$} │ │ │ │", ac_type, departure_time, alternate, route_split[2].to_string()+rem_02.as_str());
|
println!("│ {: >longest_block_leftmost$} │ {: >longest_block_2nd_leftmost$} │ {: >4} │ {: <main_wrap$} │ │ │ │", ac_type, departure_time, alternate, route_split[2].to_string()+rem_02.as_str());
|
||||||
println!("│{: >leftmost_with_padding$}├{:─>tnd_leftmost_with_padding$}┤ │ {: <main_wrap$} │──────┼──────┼──────┤", "", "", rem_03);
|
println!("│{: >leftmost_with_padding$}├{:─>tnd_leftmost_with_padding$}┤ │ {: <main_wrap$} │──────┼──────┼──────┤", "", "", rem_03);
|
||||||
println!("│ {:0>3}{: >ft_offset$} │ {: >longest_block_2nd_leftmost$} │ │ {: <main_wrap$} │ │ │ │", cid, flight_type, cruise_alt, rem_04);
|
println!("│ {:0>3}{: >ft_offset$} │ {: >longest_block_2nd_leftmost$} │ │ {: <main_wrap$} │ │ │ │", cid, flight_type, cruise_alt, rem_04);
|
||||||
println!("└{:─>leftmost_with_padding$}┴{:─>tnd_leftmost_with_padding$}┴──────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────┴──────┴──────┘", "", "");
|
println!("└{:─>leftmost_with_padding$}┴{:─>tnd_leftmost_with_padding$}┴──────┴────────────────────────────────────────────────────────────────────────────────┴──────┴──────┴──────┘", "", "");
|
||||||
println!("--- END FLIGHT PROGRESS STRIP READOUT FOR {} ---", callsign);
|
println!("--- END FLIGHT PROGRESS STRIP READOUT FOR {} ---", callsign);
|
||||||
}
|
}
|
Loading…
Reference in New Issue