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

Method SubmitFakeLocationPoint

qt/draw_widget.cpp:515–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513}
514
515void DrawWidget::SubmitFakeLocationPoint(m2::PointD const & pt)
516{
517 m_emulatingLocation = true;
518
519 m2::PointD const point = GetCoordsFromSettingsIfExists(true /* start */, pt, false /* pointIsMercator */);
520
521 m_framework.OnLocationUpdate(qt::common::MakeGpsInfo(point));
522
523 auto & routingManager = m_framework.GetRoutingManager();
524 if (routingManager.IsRoutingActive())
525 {
526 /// Immediate update of the position in Route to get updated FollowingInfo state for visual debugging.
527 /// m_framework.OnLocationUpdate calls RoutingSession::OnLocationPositionChanged
528 /// with delay several times according to interpolation.
529 /// @todo Write log when the final point will be reached and
530 /// RoutingSession::OnLocationPositionChanged will be called the last time.
531 routingManager.RoutingSession().OnLocationPositionChanged(qt::common::MakeGpsInfo(point));
532
533 routing::FollowingInfo loc;
534 routingManager.GetRouteFollowingInfo(loc);
535 if (routingManager.GetCurrentRouterType() == routing::RouterType::Pedestrian)
536 {
537 LOG(LDEBUG, ("Distance:", loc.m_distToTarget, "Time:", loc.m_time, DebugPrint(loc.m_pedestrianTurn), "in",
538 loc.m_distToTurn.ToString(), loc.m_nextStreetName.empty() ? "" : "to " + loc.m_nextStreetName));
539 }
540 else
541 {
542 std::string speed;
543 if (loc.m_speedLimitMps > 0)
544 speed = "SpeedLimit: " +
545 measurement_utils::FormatSpeedNumeric(loc.m_speedLimitMps, measurement_utils::Units::Metric);
546
547 LOG(LDEBUG, ("Distance:", loc.m_distToTarget, "Time:", loc.m_time, speed, GetTurnString(loc.m_turn),
548 (loc.m_exitNum != 0 ? ":" + std::to_string(loc.m_exitNum) : ""), "in", loc.m_distToTurn.ToString(),
549 loc.m_nextStreetName.empty() ? "" : "to " + loc.m_nextStreetName));
550 }
551 }
552}
553
554void DrawWidget::SubmitRulerPoint(m2::PointD const & pt)
555{

Callers

nothing calls this directly

Calls 13

MakeGpsInfoFunction · 0.85
FormatSpeedNumericFunction · 0.85
GetTurnStringFunction · 0.85
to_stringFunction · 0.85
IsRoutingActiveMethod · 0.80
RoutingSessionMethod · 0.80
GetCurrentRouterTypeMethod · 0.80
DebugPrintFunction · 0.70
OnLocationUpdateMethod · 0.45
GetRouteFollowingInfoMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected