Shared trip: one itinerary per server (data/trip.json, GET/PUT /api/trip, routed server-side), the route panel edits it when logged in and polls other screens' changes in without moving the camera; the GNSS simulation skips trips under 1 km and starts elsewhere when it can't get on from a road island; the car's server updates itself from a topbar button (SELF_UPDATE=1: newer main with CI passed → bin/update-maptool.sh via maptool-update.path); Android Auto and the trip's next steps in TODO
This commit is contained in:
1 parent
5f4c7c6ee8
commit
17891c53b5
16 files changed
+513
-5
No files matched your search
+10
-1
@@ -30,7 +30,7 @@ class GnssSimTest < Minitest::Test
|
||||
(@tried ||= []) << position
|
||||
raise Maptool::Routing::RouteError, "no road" if @tried.size == 1
|
||||
|
||||
{ geometry: { coordinates: [position, position] }, properties: {} }
|
||||
{ geometry: { coordinates: [position, position] }, properties: { distance_km: 5 } }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -41,4 +41,13 @@ class GnssSimTest < Minitest::Test
|
||||
assert position[0].between?(17.0, 18.0) && position[1].between?(48.0, 49.0)
|
||||
assert_equal position, route[:geometry][:coordinates].first
|
||||
end
|
||||
|
||||
def test_a_route_under_a_km_is_another_try_and_none_at_all_an_error
|
||||
lengths = [0.0, 0.2, 3.0]
|
||||
router = ->(*) { { geometry: { coordinates: [[1, 2], [1, 3]] }, properties: { distance_km: lengths.shift } } }
|
||||
sim = Maptool::GnssSim.new("http://valhalla", router: router)
|
||||
assert_equal 3.0, sim.random_route([1, 2])[:properties][:distance_km]
|
||||
lengths = [0.0] * 5
|
||||
assert_raises(Maptool::Routing::RouteError) { sim.random_route([1, 2]) }
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user