WIP screen: Different slash screen for
This commit is contained in:
parent
b079b509ae
commit
95c2376caf
2 changed files with 37 additions and 29 deletions
|
|
@ -58,6 +58,7 @@ mod io;
|
||||||
mod screen;
|
mod screen;
|
||||||
#[cfg(feature = "gnss_ubx")]
|
#[cfg(feature = "gnss_ubx")]
|
||||||
mod ubx;
|
mod ubx;
|
||||||
|
mod util;
|
||||||
|
|
||||||
const WIFI_CHANNEL: radio::Channel = 180;
|
const WIFI_CHANNEL: radio::Channel = 180;
|
||||||
const WIFI_TXPOWER: i8 = 10; // dBm, 2..20
|
const WIFI_TXPOWER: i8 = 10; // dBm, 2..20
|
||||||
|
|
|
||||||
|
|
@ -614,41 +614,48 @@ where
|
||||||
|
|
||||||
self.clear_all()?;
|
self.clear_all()?;
|
||||||
|
|
||||||
let sig_width = i32::from(self.size.width) / 3;
|
#[cfg(feature = "spat")]
|
||||||
let circle_dia = 50;
|
|
||||||
let circle_margin = (sig_width - circle_dia) / 2;
|
|
||||||
|
|
||||||
for (idx, style) in [Self::RD_STYLE, Self::YE_STYLE, Self::GN_STYLE]
|
|
||||||
.iter()
|
|
||||||
.enumerate()
|
|
||||||
{
|
{
|
||||||
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
let sig_width = i32::from(self.size.width) / 3;
|
||||||
let offset = (idx as i32) * sig_width;
|
let circle_dia = 50;
|
||||||
|
let circle_margin = (sig_width - circle_dia) / 2;
|
||||||
|
|
||||||
primitives::Circle::new(
|
for (idx, style) in [Self::RD_STYLE, Self::YE_STYLE, Self::GN_STYLE]
|
||||||
geometry::Point::new(offset + circle_margin, 15 + self.size.offset_top),
|
.iter()
|
||||||
circle_dia.cast_unsigned(),
|
.enumerate()
|
||||||
|
{
|
||||||
|
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)]
|
||||||
|
let offset = (idx as i32) * sig_width;
|
||||||
|
|
||||||
|
primitives::Circle::new(
|
||||||
|
geometry::Point::new(offset + circle_margin, 15 + self.size.offset_top),
|
||||||
|
circle_dia.cast_unsigned(),
|
||||||
|
)
|
||||||
|
.into_styled(*style)
|
||||||
|
.draw(&mut self.target)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
// draw welcome text
|
||||||
|
let centerline = i32::from(self.size.width) / 2;
|
||||||
|
|
||||||
|
embedded_graphics::image::Image::new(
|
||||||
|
&self.bike_image,
|
||||||
|
geometry::Point::new(centerline - (45 / 2) + 1, 75 + self.size.offset_top),
|
||||||
|
)
|
||||||
|
.draw(&mut self.target)?;
|
||||||
|
|
||||||
|
text::Text::with_alignment(
|
||||||
|
"C-ITS Signal Phase\nWaiting for GNSS...",
|
||||||
|
geometry::Point::new(centerline, 130 + self.size.offset_top),
|
||||||
|
text_style,
|
||||||
|
text::Alignment::Center,
|
||||||
)
|
)
|
||||||
.into_styled(*style)
|
|
||||||
.draw(&mut self.target)?;
|
.draw(&mut self.target)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw welcome text
|
// show features
|
||||||
let centerline = i32::from(self.size.width) / 2;
|
let enabled_features = crate::util::get_rx_feature_list();
|
||||||
|
let enabled_tx_features = crate::util::get_tx_feature_list();
|
||||||
embedded_graphics::image::Image::new(
|
|
||||||
&self.bike_image,
|
|
||||||
geometry::Point::new(centerline - (45 / 2) + 1, 75 + self.size.offset_top),
|
|
||||||
)
|
|
||||||
.draw(&mut self.target)?;
|
|
||||||
|
|
||||||
text::Text::with_alignment(
|
|
||||||
"C-ITS Signal Phase\nWaiting for GNSS...",
|
|
||||||
geometry::Point::new(centerline, 130 + self.size.offset_top),
|
|
||||||
text_style,
|
|
||||||
text::Alignment::Center,
|
|
||||||
)
|
|
||||||
.draw(&mut self.target)?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue