map: Extract max end time
This commit is contained in:
parent
10653429e5
commit
38434b0d86
1 changed files with 11 additions and 1 deletions
|
|
@ -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| {
|
||||
|
|
|
|||
Loading…
Reference in a new issue