Watch
0
0
Fork
You've already forked esp32-c_its-companion
0

map: Extract max end time

This commit is contained in:
Jannik Beyerstedt 2026-08-15 21:08:50 +02:00
commit 38434b0d86

View file

@ -173,6 +173,12 @@ impl Intersection {
{
sig_grp.likely_time = Some(likely.to_datetime_from_moy(moy, year));
}
if let Some(max) = &timing.max_end_time
&& !max.is_out_of_range()
&& !max.is_unknown()
{
sig_grp.max_end_time = Some(max.to_datetime_from_moy(moy, year));
}
}
}
} else {
@ -223,6 +229,7 @@ impl Intersection {
target_lanes,
phase: None,
min_end_time: None,
max_end_time: None,
likely_time: None,
}
})
@ -410,7 +417,7 @@ pub struct SignalGroup {
/// current signal phase
phase: Option<etsi_its_dsrc::MovementPhaseState>,
min_end_time: Option<chrono::DateTime<chrono::Utc>>,
// max_end_time: Option<chrono::DateTime<chrono::Utc>>,
max_end_time: Option<chrono::DateTime<chrono::Utc>>,
likely_time: Option<chrono::DateTime<chrono::Utc>>,
}
@ -443,6 +450,9 @@ impl SignalGroup {
pub fn likely_time(&self) -> Option<chrono::prelude::DateTime<chrono::prelude::Utc>> {
self.likely_time
}
pub fn max_end_time(&self) -> Option<chrono::prelude::DateTime<chrono::prelude::Utc>> {
self.max_end_time
}
pub fn phase_to_str(&self) -> Option<String> {
self.phase.map(|v| {