store offset in the permanent signal format

This commit is contained in:
Dustin Carlino 2020-08-08 09:45:59 -07:00
parent 49e8ab3680
commit eee179ce8a
2 changed files with 3 additions and 2 deletions

2
Cargo.lock generated
View File

@ -2782,7 +2782,7 @@ dependencies = [
[[package]]
name = "seattle_traffic_signals"
version = "0.1.0"
source = "git+https://github.com/dabreegster/seattle_traffic_signals#9a3a77da15a7eefacc5553579c0b80b7eeae2ff4"
source = "git+https://github.com/dabreegster/seattle_traffic_signals#ccc37b56a1f879a15fc1e4402785cf9b21f12703"
dependencies = [
"include_dir 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.110 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -255,6 +255,7 @@ impl ControlTrafficSignal {
},
})
.collect(),
offset_seconds: self.offset.inner_seconds() as usize,
}
}
@ -300,7 +301,7 @@ impl ControlTrafficSignal {
ControlTrafficSignal {
id,
phases,
offset: Duration::ZERO,
offset: Duration::seconds(raw.offset_seconds as f64),
turn_groups: TurnGroup::for_i(id, map),
}
.validate()