Clean up commented out code from Going to re-evaluate how problems along a trip are shown in the UI anyway.
@@ -580,86 +580,6 @@ fn make_timeline(
DrawWithTooltips::new(ctx, batch, tooltips, Box::new(|_| GeomBatch::new()))
}
-// TODO Restore this, figuring out why some delays don't show up
-/*
- let mut sum_phase_dist = Distance::ZERO;
- if let Some(step_list) = &p.path {
- let mut norm_distance = Distance::meters(0.0);
- for step in step_list.get_steps() {
- match step {
- PathStep::Lane(id) | PathStep::ContraflowLane(id) => {
- let lane_detail = map.get_l(*id);
- sum_phase_dist += lane_detail.length();
- if let Some(avg_speed) = lane_speeds.get(id) {
- segments.push((
- norm_distance,
- norm_color,
- build_text(app, &msgs, norm_distance),
- ));
- let mut display_txt = Text::from(&p.phase_type.describe(map));
- display_txt.add(format!(
- " Road: {}",
- map.get_r(lane_detail.parent)
- .get_name(app.opts.language.as_ref())
- ));
- display_txt.add(format!(" Lane ID: {}", id));
- display_txt.add(format!(
- " Lane distance: {}",
- lane_detail.length().to_string(&app.opts.units)
- ));
- display_txt.add(format!(" Average speed: {}", avg_speed));
- segments.push((lane_detail.length(), Color::RED, display_txt));
- norm_distance = Distance::meters(0.0);
- } else {
- norm_distance += lane_detail.length();
- }
- }
- PathStep::Turn(id) => {
- let turn_details = map.get_t(*id);
- sum_phase_dist += turn_details.geom.length();
- if let Some(delay) = intersection_delays.get(id) {
- segments.push((
- norm_distance,
- norm_color,
- build_text(app, &msgs, norm_distance),
- ));
-
- let mut display_txt = Text::from(&p.phase_type.describe(map));
- display_txt.add(format!(" Intersection: {}", id.parent));
- display_txt.add(format!(
- " Delay: {}",
- Duration::seconds(*delay as f64)
- ));
- segments.push((
- // To make sure that the hotspot isn't too small
- if 0.05 < (turn_details.geom.length() / sum_phase_dist) {
- turn_details.geom.length()
- } else {
- sum_phase_dist += sum_phase_dist * 0.05;
- sum_phase_dist -= turn_details.geom.length();
- sum_phase_dist * 0.05
- },
- Color::RED,
- display_txt,
- ));
- norm_distance = Distance::meters(0.0);
- } else {
- norm_distance += turn_details.geom.length();
- }
- }
- }
- }
- segments.push((
- norm_distance,
- norm_color,
- build_text(app, &msgs, norm_distance),
- ));
- } else {
- // TODO Think of something to do instead
- error!("No path for {}", trip_id)
- }
-*/
-
/// Creates the timeline, location warp, and time warp buttons for one trip, and draws the route on
/// the map.
fn make_trip_details(
