From fc674df9ac3662686a9e2212e1e495cb7113d360 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Thu, 2 Dec 2021 13:29:42 +0000 Subject: [PATCH] Cleaning up the map_model transit representation a bit. #372 --- game/src/info/transit.rs | 11 +---------- game/src/layer/transit.rs | 2 +- map_model/src/edits/perma.rs | 14 +++++--------- map_model/src/map.rs | 4 ++-- map_model/src/objects/transit.rs | 11 ++++++----- sim/src/events.rs | 4 +++- tests/src/main.rs | 6 +----- 7 files changed, 19 insertions(+), 33 deletions(-) diff --git a/game/src/info/transit.rs b/game/src/info/transit.rs index 8556ddc02b..0dfbbf0d82 100644 --- a/game/src/info/transit.rs +++ b/game/src/info/transit.rs @@ -202,15 +202,6 @@ fn route_body(ctx: &mut EventCtx, app: &App, details: &mut Details, id: TransitR .into_widget(ctx), ); - if app.opts.dev { - rows.push( - ctx.style() - .btn_outline - .text("Open OSM relation") - .build_widget(ctx, format!("open {}", route.osm_rel_id)), - ); - } - let buses = app.primary.sim.status_of_buses(id, map); let mut bus_locations = Vec::new(); if buses.is_empty() { @@ -330,7 +321,7 @@ fn route_body(ctx: &mut EventCtx, app: &App, details: &mut Details, id: TransitR // Draw the route, label stops, and show location of buses { let mut colorer = ColorNetwork::new(app); - for req in route.all_steps(map) { + for req in route.all_path_requests(map) { for step in map.pathfind(req).unwrap().get_steps() { if let PathStep::Lane(l) = step { colorer.add_l(*l, app.cs.unzoomed_bus); diff --git a/game/src/layer/transit.rs b/game/src/layer/transit.rs index e3d42fd5ce..1a39e31a0f 100644 --- a/game/src/layer/transit.rs +++ b/game/src/layer/transit.rs @@ -87,7 +87,7 @@ impl TransitNetwork { if !show_trains && tr.route_type == PathConstraints::Train { continue; } - for req in tr.all_steps(map) { + for req in tr.all_path_requests(map) { if let Ok(path) = map.pathfind(req) { for step in path.get_steps() { if let PathStep::Lane(l) = step { diff --git a/map_model/src/edits/perma.rs b/map_model/src/edits/perma.rs index ea43e202f0..814c9932fb 100644 --- a/map_model/src/edits/perma.rs +++ b/map_model/src/edits/perma.rs @@ -58,7 +58,7 @@ pub enum PermanentEditCmd { old: PermanentEditIntersection, }, ChangeRouteSchedule { - osm_rel_id: osm::RelationID, + gtfs_id: String, old: Vec