| 513 | } |
| 514 | |
| 515 | void 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 | |
| 554 | void DrawWidget::SubmitRulerPoint(m2::PointD const & pt) |
| 555 | { |
nothing calls this directly
no test coverage detected