added increase and decrease for min distance
to autopilot menu
This commit is contained in:
@@ -153,6 +153,20 @@ void MenuAutopilot::printPage() const {
|
||||
lineTwo = "deactivated";
|
||||
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:
|
||||
this->printDefault();
|
||||
return;
|
||||
@@ -162,7 +176,7 @@ void MenuAutopilot::printPage() const {
|
||||
}
|
||||
|
||||
void MenuAutopilot::runCommand() const {
|
||||
switch (this->getCountPages()) {
|
||||
switch (this->getCurrentPage()) {
|
||||
case 6:
|
||||
this->autopilot->restart();
|
||||
break;
|
||||
@@ -176,6 +190,14 @@ void MenuAutopilot::runCommand() const {
|
||||
this->driveManager->getNavigation()->freezeTargetPoint();
|
||||
}
|
||||
break;
|
||||
|
||||
case 8:
|
||||
this->minDistance = this->driveManager->getNavigation()->increaseMinDistanceToReachPoint();
|
||||
break;
|
||||
|
||||
case 9:
|
||||
this->minDistance = this->driveManager->getNavigation()->decreaseMinDistanceToReachPoint();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
@@ -191,8 +213,10 @@ void MenuAutopilot::update() {
|
||||
}
|
||||
|
||||
void MenuAutopilot::init() {
|
||||
this->setCountPages(8);
|
||||
this->setCountPages(10);
|
||||
this->driveManager->changeModus(Modi::Autopilot);
|
||||
this->autopilot = (Autopilot*) this->driveManager->getDriveModiPtr();
|
||||
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;
|
||||
|
||||
bool mutable targetFreezed = false;
|
||||
double mutable minDistance;
|
||||
|
||||
Autopilot* autopilot;
|
||||
RouteInfo routeInfo;
|
||||
|
||||
Reference in New Issue
Block a user