added increase and decrease for min distance

to autopilot menu
This commit is contained in:
2023-05-24 13:49:14 +02:00
parent 6a2a437e21
commit 56f506e1b5
2 changed files with 27 additions and 2 deletions
@@ -153,6 +153,20 @@ void MenuAutopilot::printPage() const {
lineTwo = "deactivated"; lineTwo = "deactivated";
break; break;
case 8:
lineOne = "MinDisToPoint:";
lineTwo = "";
lineTwo.concat(this->minDistance);
lineTwo.concat(" - Increase");
break;
case 9:
lineOne = "MinDisToPoint:";
lineTwo = "";
lineTwo.concat(this->minDistance);
lineTwo.concat(" - Decrease");
break;
default: default:
this->printDefault(); this->printDefault();
return; return;
@@ -162,7 +176,7 @@ void MenuAutopilot::printPage() const {
} }
void MenuAutopilot::runCommand() const { void MenuAutopilot::runCommand() const {
switch (this->getCountPages()) { switch (this->getCurrentPage()) {
case 6: case 6:
this->autopilot->restart(); this->autopilot->restart();
break; break;
@@ -176,6 +190,14 @@ void MenuAutopilot::runCommand() const {
this->driveManager->getNavigation()->freezeTargetPoint(); this->driveManager->getNavigation()->freezeTargetPoint();
} }
break; break;
case 8:
this->minDistance = this->driveManager->getNavigation()->increaseMinDistanceToReachPoint();
break;
case 9:
this->minDistance = this->driveManager->getNavigation()->decreaseMinDistanceToReachPoint();
break;
default: default:
break; break;
@@ -191,8 +213,10 @@ void MenuAutopilot::update() {
} }
void MenuAutopilot::init() { void MenuAutopilot::init() {
this->setCountPages(8); this->setCountPages(10);
this->driveManager->changeModus(Modi::Autopilot); this->driveManager->changeModus(Modi::Autopilot);
this->autopilot = (Autopilot*) this->driveManager->getDriveModiPtr(); this->autopilot = (Autopilot*) this->driveManager->getDriveModiPtr();
this->routeInfo = this->autopilot->getRouteInfo(); this->routeInfo = this->autopilot->getRouteInfo();
this->driveManager->getNavigation()->increaseMinDistanceToReachPoint();
this->minDistance = this->driveManager->getNavigation()->decreaseMinDistanceToReachPoint();
} }
@@ -48,6 +48,7 @@ class MenuAutopilot : public MenuDriveMode {
void init() override; void init() override;
bool mutable targetFreezed = false; bool mutable targetFreezed = false;
double mutable minDistance;
Autopilot* autopilot; Autopilot* autopilot;
RouteInfo routeInfo; RouteInfo routeInfo;