From 39ff3b13101b5b0e7f6886a9b0562265c25e5c60 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Wed, 4 Mar 2020 16:38:01 -0800 Subject: [PATCH] representing beg buttons, but no data entry yet. --- map_model/src/traffic_signals.rs | 2 ++ traffic_signals/src/data/53219808.json | 3 ++- traffic_signals/src/lib.rs | 29 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/map_model/src/traffic_signals.rs b/map_model/src/traffic_signals.rs index 3e23505baf..0a40ce9661 100644 --- a/map_model/src/traffic_signals.rs +++ b/map_model/src/traffic_signals.rs @@ -682,6 +682,8 @@ impl ControlTrafficSignal { }) .collect(), offset_seconds: self.offset.inner_seconds() as usize, + // TODO + walk_buttons: traffic_signals::WalkButtons::Complicated, observed, audited: self.audit_md.clone(), }; diff --git a/traffic_signals/src/data/53219808.json b/traffic_signals/src/data/53219808.json index cb20b109f3..bec6896623 100644 --- a/traffic_signals/src/data/53219808.json +++ b/traffic_signals/src/data/53219808.json @@ -401,6 +401,7 @@ } ], "offset_seconds": 0, + "walk_buttons": "Complicated", "observed": { "author": "Dustin Carlino", "datetime": "MM/DD/YYYY HH:MM:SS", @@ -411,4 +412,4 @@ "datetime": "MM/DD/YYYY HH:MM:SS", "notes": "no notes" } -} \ No newline at end of file +} diff --git a/traffic_signals/src/lib.rs b/traffic_signals/src/lib.rs index 4ade8f2207..eeb30fd06d 100644 --- a/traffic_signals/src/lib.rs +++ b/traffic_signals/src/lib.rs @@ -11,6 +11,8 @@ pub struct TrafficSignal { pub phases: Vec, // TODO What should this be relative to? pub offset_seconds: usize, + /// Describes the pedestrian buttons for this signal. + pub walk_buttons: WalkButtons, /// Information about the person mapping the signal. pub observed: Metadata, /// Information about the latest person to verify a previously mapped signal. @@ -77,6 +79,33 @@ pub struct Metadata { pub notes: String, } +/// Describes the type of pedestrian buttons present at the intersection. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum WalkButtons { + /// The intersection has no pedestrian buttons at all. The walk sign comes on automatically + /// during the vehicle phases or as a dedicated all-walk phase. + NoButtons, + /// Buttons are present, but the walk sign comes on automatically regardless of pushing the + /// buttons. Additional ADA sounds may happen when pressing the button. Pressing the button + /// does not alter how quickly phases change. + Optional, + /// Buttons are present, but the walk sign comes on automatically regardless of pushing the + /// buttons. Pressing the button reliably causes the walk sign to appear faster than if not + /// pressed. + OptionalButNice, + /// Buttons are present and required. If nobody presses the button, no walk sign appears. After + /// pressing the button, the signal continues to cycle through phases at the same speed as it + /// would without pressing the button. + SlowBeg, + /// Buttons are present and required. If nobody presses the button, no walk sign appears. After + /// pressing the button, the signal reliably gives a walk sign within 15 seconds of pressing + /// the button. + FastBeg, + /// Some other situation not covered by the above. For example, the intersection might have + /// buttons only for some crosswalks, but not others. + Complicated, +} + static DATA: include_dir::Dir = include_dir::include_dir!("src/data"); /// Returns all traffic signal data compiled into this build, keyed by OSM node ID.