fn build_tab_coverage<A: tui::backend::Backend>(
    f: &mut tui::Frame<A>,
    chunks: Vec<Rect>,
    settings: &Settings,
    coverage_airplanes: &[(f64, f64, u8, ICAO)],
) {
    let canvas = Canvas::default()
        .block(Block::default().title("Coverage").borders(Borders::ALL))
        .x_bounds([MAX_PLOT_LOW, MAX_PLOT_HIGH])
        .y_bounds([MAX_PLOT_LOW, MAX_PLOT_HIGH])
        .paint(|ctx| {
            ctx.layer();

            // draw locations
            draw_locations(ctx, settings);

            // draw ADSB tab airplanes
            for (lat, long, seen_number, _) in coverage_airplanes.iter() {
                let (x, y) = settings.to_xy(*lat, *long);

                let number: u16 = 100_u16 + (u16::from(*seen_number) * 100);
                let color_number: u8 = if number > u16::from(u8::MAX) {
                    u8::MAX
                } else {
                    number as u8
                };

                // draw dot on location
                ctx.draw(&Points {
                    coords: &[(x, y)],
                    color: Color::Rgb(color_number, color_number, color_number),
                });
            }
        });
    f.render_widget(canvas, chunks[1]);
}
/// Render Coverage tab for tui display
Render Coverage tab for tui display
Render Coverage tab for tui display
fn build_tab_coverage<A: tui::backend::Backend>(
    f: &mut tui::Frame<A>,
    chunks: Vec<Rect>,
    settings: &Settings,
    coverage_airplanes: &[(f64, f64, u8, ICAO)],
) {
    let canvas = Canvas::default()
        .block(Block::default().title("Coverage").borders(Borders::ALL))
        .x_bounds([MAX_PLOT_LOW, MAX_PLOT_HIGH])
        .y_bounds([MAX_PLOT_LOW, MAX_PLOT_HIGH])
        .paint(|ctx| {
            ctx.layer();
            // draw locations
            draw_locations(ctx, settings);
            // draw ADSB tab airplanes
            for (lat, long, seen_number, _) in coverage_airplanes.iter() {
                let (x, y) = settings.to_xy(*lat, *long);
                let number: u16 = 100_u16 + (u16::from(*seen_number) * 100);
                let color_number: u8 = if number > u16::from(u8::MAX) {
                    u8::MAX
                } else {
                    number as u8
                };
                // draw dot on location
                ctx.draw(&Points {
                    coords: &[(x, y)],
                    color: Color::Rgb(color_number, color_number, color_number),
                });
            }
        });
    f.render_widget(canvas, chunks[1]);
}
fn build_tab_coverage < A : tui :: backend :: Backend > ( f : & mut tui :: Frame < A > , chunks : Vec < Rect > , settings : & Settings , coverage_airplanes : & [ ( f64 , f64 , u8 , ICAO ) ] , ) { let canvas = Canvas :: default ( ) . block ( Block :: default ( ) . title ( " " ) . borders ( Borders :: ALL ) ) . x_bounds ( [ MAX_PLOT_LOW , MAX_PLOT_HIGH ] ) . y_bounds ( [ MAX_PLOT_LOW , MAX_PLOT_HIGH ] ) . paint ( | ctx | { ctx . layer ( ) ; // draw locations draw_locations ( ctx , settings ) ; // draw ADSB tab airplanes for ( lat , long , seen_number , _ ) in coverage_airplanes . iter ( ) { let ( x , y ) = settings . to_xy ( * lat , * long ) ; let number : u16 = 100_u16 + ( u16 :: from ( * seen_number ) * 100 ) ; let color_number : u8 = if number > u16 :: from ( u8 :: MAX ) { u8 :: MAX } else { number as u8 } ; // draw dot on location ctx . draw ( & Points { coords : & [ ( x , y ) ] , color : Color :: Rgb ( color_number , color_number , color_number ) , } ) ; } } ) ; f . render_widget ( canvas , chunks [ 1 ] ) ; }
Render Coverage tab for tui display
Render Coverage tab for tui display
f
&mut tui::Frame<A>
chunks
Vec<Rect>
settings
&Settings
coverage_airplanes
&[(f64, f64, u8, ICAO)]
f
&mut tui::Frame<A>
chunks
Vec<Rect>
settings
&Settings
coverage_airplanes
&[(f64, f64, u8, ICAO)]