From 7418adb0273b46b92dd5e7d8b32add7bfd3abe62 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Tue, 23 May 2023 23:24:16 +0200 Subject: [PATCH] saved status of freezing target point in the autopilot menu --- src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp | 7 +++++-- src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp b/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp index 9ca1220..759fdfa 100644 --- a/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp +++ b/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp @@ -168,10 +168,13 @@ void MenuAutopilot::runCommand() const { break; case 7: - if (this->targetFreezed) + if (this->targetFreezed) { + this->targetFreezed = false; this->driveManager->getNavigation()->freezeTargetPoint(false); - else + } else { + this->targetFreezed = true; this->driveManager->getNavigation()->freezeTargetPoint(); + } break; default: diff --git a/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h b/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h index 71c8ce3..7783f64 100644 --- a/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h +++ b/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h @@ -47,7 +47,7 @@ class MenuAutopilot : public MenuDriveMode { private: void init() override; - bool targetFreezed = false; + bool mutable targetFreezed = false; Autopilot* autopilot; RouteInfo routeInfo;