spat: Show signal groups without timing information
This commit is contained in:
parent
f732585989
commit
ff45df8204
4 changed files with 35 additions and 24 deletions
|
|
@ -66,7 +66,7 @@ pub struct State {
|
|||
pub struct SignalGroupData {
|
||||
pub phase: SignalPhase,
|
||||
pub maneuver: map::Maneuvers,
|
||||
pub min_end_sec: i16,
|
||||
pub min_end_sec: Option<i16>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "spat")]
|
||||
|
|
@ -285,15 +285,19 @@ impl State {
|
|||
|
||||
use num_traits::Float;
|
||||
|
||||
let min_end = sig.min_end_time();
|
||||
let dur = min_end.sub(self.time.and_utc()).as_seconds_f32();
|
||||
|
||||
let phase = sig
|
||||
.phase()
|
||||
.map(core::convert::Into::into)
|
||||
.unwrap_or_default();
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
let min_end_sec = dur.round() as i16;
|
||||
|
||||
let min_end_sec = sig.min_end_time().map(|time| {
|
||||
let dur = time.sub(self.time.and_utc()).as_seconds_f32();
|
||||
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
let min_end_sec = dur.round() as i16;
|
||||
|
||||
min_end_sec
|
||||
});
|
||||
|
||||
Some(SignalGroupData {
|
||||
phase,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue