MCPcopy Create free account
hub / github.com/comaps/comaps / GenerateNotifications

Method GenerateNotifications

libs/routing/routing_session.cpp:531–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529}
530
531void RoutingSession::GenerateNotifications(std::vector<std::string> & notifications, bool announceStreets)
532{
533 CHECK_THREAD_CHECKER(m_threadChecker, ());
534 notifications.clear();
535
536 ASSERT(m_route, ());
537
538 // Generate recalculating notification if needed and reset
539 if (m_routingRebuildCount > m_routingRebuildAnnounceCount)
540 {
541 m_routingRebuildAnnounceCount = m_routingRebuildCount;
542 notifications.emplace_back(m_turnNotificationsMgr.GenerateRecalculatingText());
543 return;
544 }
545
546 // Voice turn notifications.
547 if (!m_routingSettings.m_soundDirection)
548 return;
549
550 if (!m_route->IsValid() || !IsNavigable())
551 return;
552
553 // Generate turns notifications.
554 std::vector<turns::TurnItemDist> turns;
555 if (m_route->GetNextTurns(turns))
556 {
557 RouteSegment::RoadNameInfo nextStreetInfo;
558
559 // only populate nextStreetInfo if TtsStreetNames is enabled
560 if (announceStreets)
561 m_route->GetNextTurnStreetName(nextStreetInfo);
562
563 m_turnNotificationsMgr.GenerateTurnNotifications(turns, notifications, nextStreetInfo);
564 }
565
566 m_speedCameraManager.GenerateNotifications(notifications);
567}
568
569void RoutingSession::AssignRoute(std::shared_ptr<Route> const & route, RouterResultCode e)
570{

Callers 1

CheckVoiceNotificationFunction · 0.45

Calls 8

ASSERTFunction · 0.85
GetNextTurnsMethod · 0.80
GetNextTurnStreetNameMethod · 0.80
clearMethod · 0.45
emplace_backMethod · 0.45
IsValidMethod · 0.45

Tested by 1

CheckVoiceNotificationFunction · 0.36