| 3690 | } |
| 3691 | |
| 3692 | void MapEditorController::alignMapWithNorth(bool enable) |
| 3693 | { |
| 3694 | const int update_interval = 1000; // milliseconds |
| 3695 | |
| 3696 | if (enable) |
| 3697 | { |
| 3698 | Compass::getInstance().startUsage(); |
| 3699 | gps_display->enableHeadingIndicator(true); |
| 3700 | |
| 3701 | connect(&align_map_with_north_timer, &QTimer::timeout, this, &MapEditorController::alignMapWithNorthUpdate); |
| 3702 | align_map_with_north_timer.start(update_interval); |
| 3703 | alignMapWithNorthUpdate(); |
| 3704 | } |
| 3705 | else |
| 3706 | { |
| 3707 | align_map_with_north_timer.disconnect(); |
| 3708 | align_map_with_north_timer.stop(); |
| 3709 | |
| 3710 | gps_display->enableHeadingIndicator(false); |
| 3711 | Compass::getInstance().stopUsage(); |
| 3712 | |
| 3713 | main_view->setRotation(0); |
| 3714 | } |
| 3715 | } |
| 3716 | |
| 3717 | void MapEditorController::alignMapWithNorthUpdate() |
| 3718 | { |
nothing calls this directly
no test coverage detected