diff --git a/map/framework.cpp b/map/framework.cpp index 0ea8c83495..66913df68a 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -2190,6 +2190,13 @@ void Framework::SetRouterImpl(RouterType type) m_currentRouterType = type; } +void Framework::SetRouteBuildingListener(TRouteBuildingCallback const & buildingCallback, + TRouteProgressCallback const & progressCallback) +{ + m_routingCallback = buildingCallback; + m_progressCallback = progressCallback; +} + void Framework::RemoveRoute() { m_bmManager.UserMarksClear(UserMarkContainer::DEBUG_MARK); diff --git a/map/framework.hpp b/map/framework.hpp index f4d1d7127c..48191cb773 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -565,11 +565,8 @@ public: typedef function const &, vector const &)> TRouteBuildingCallback; typedef function TRouteProgressCallback; - void SetRouteBuildingListener(TRouteBuildingCallback const & buildingCallback, TRouteProgressCallback const & progressCallback) - { - m_routingCallback = buildingCallback; - m_progressCallback = progressCallback; - } + void SetRouteBuildingListener(TRouteBuildingCallback const & buildingCallback, + TRouteProgressCallback const & progressCallback); void FollowRoute() { GetLocationState()->StartRouteFollow(); } void CloseRouting(); void GetRouteFollowingInfo(location::FollowingInfo & info) { m_routingSession.GetRouteFollowingInfo(info); } diff --git a/routing/async_router.cpp b/routing/async_router.cpp index 64728aba0e..3a7c6dd629 100644 --- a/routing/async_router.cpp +++ b/routing/async_router.cpp @@ -198,10 +198,9 @@ void AsyncRouter::CalculateRouteImpl(TReadyCallback const & readyCallback, TProg } if (!absent.empty() && code == IRouter::NoError) - { code = IRouter::NeedMoreMaps; - } + elapsedSec = timer.ElapsedSeconds(); // routing time + absents fetch time LogCode(code, elapsedSec); SendStatistics(startPoint, startDirection, finalPoint, code, route, elapsedSec); // Call callback only if we have some new data. diff --git a/routing/osrm_router.cpp b/routing/osrm_router.cpp index 995968eda1..c38afb0943 100644 --- a/routing/osrm_router.cpp +++ b/routing/osrm_router.cpp @@ -582,7 +582,7 @@ OsrmRouter::ResultCode OsrmRouter::CalculateRoute(m2::PointD const & startPoint, LOG(LINFO, ("Duration of the start/stop points lookup", timer.ElapsedNano())); timer.Reset(); - progressCallback(15.f); + progressCallback(15.0f); // 4. Find route. RawRoutingResult routingResult; diff --git a/routing/routing_session.hpp b/routing/routing_session.hpp index e57ba444b7..56b06d9a58 100644 --- a/routing/routing_session.hpp +++ b/routing/routing_session.hpp @@ -106,8 +106,8 @@ private: void operator()(Route & route, IRouter::ResultCode e); }; - //TODO (ldragunov) Make consistent DoReady and DoProgress callbacks. Now Do ready runs - // GUI proc inside caller function, and DoProgressCallback calls inside callback wrapper. + //TODO (ldragunov) Make consistent DoReady and DoProgress callbacks. Now DoReady runs + // GUI proc inside caller function, and DoProgressCallback calls it inside callback wrapper. struct DoProgressCallback { TProgressCallbackFn m_progressCallback;