| 567 | } |
| 568 | |
| 569 | void RoutingSession::AssignRoute(std::shared_ptr<Route> const & route, RouterResultCode e) |
| 570 | { |
| 571 | CHECK_THREAD_CHECKER(m_threadChecker, ()); |
| 572 | |
| 573 | if (e != RouterResultCode::NoError) |
| 574 | { |
| 575 | // Route building was not success. If the former route is valid let's continue moving along it. |
| 576 | // If not, let's set corresponding state. |
| 577 | if (m_route->IsValid()) |
| 578 | SetState(SessionState::OnRoute); |
| 579 | else |
| 580 | SetState(SessionState::NoValidRoute); |
| 581 | return; |
| 582 | } |
| 583 | |
| 584 | RemoveRoute(); |
| 585 | SetState(SessionState::RouteNotStarted); |
| 586 | m_lastCompletionPercent = 0; |
| 587 | m_checkpoints.SetPointFrom(route->GetPoly().Front()); |
| 588 | |
| 589 | route->SetRoutingSettings(m_routingSettings); |
| 590 | m_route = route; |
| 591 | m_speedCameraManager.Reset(); |
| 592 | m_speedCameraManager.SetRoute(m_route); |
| 593 | } |
| 594 | |
| 595 | void RoutingSession::SetRouter(std::unique_ptr<IRouter> && router, std::unique_ptr<AbsentRegionsFinder> && finder) |
| 596 | { |
no test coverage detected