integrated menuInformationsSites to

driveMenu items
This commit is contained in:
2023-05-11 08:39:06 +02:00
parent 8e5a47f65b
commit df6a4b5e92
8 changed files with 64 additions and 38 deletions
@@ -10,16 +10,32 @@
*/
#include "menuCaptureRoute.h"
void MenuCaptureRoute::printMenu() {
if (this->firstPrint)
this->init();
void MenuCaptureRoute::printPage() const {
RouteInfo routeInfo = this->captureRoute->getRouteInfo();
uint8_t currentPage = this->getCurrentPage();
String lineOne = "";
String lineTwo = "";
this->routeInfo = this->captureRoute->getRouteInfo();
switch (currentPage)
{
case 0:
lineOne = "Points: ";
lineOne.concat(routeInfo.totalPoints);
lineTwo = "You can drive.";
break;
String lineOne = "Points: ";
String lineTwo = "You can drive.";
lineOne.concat(this->routeInfo.totalPoints);
case 1:
lineOne = "Average distance";
lineTwo = "xxx meters";
break;
default:
lineOne = "Unkown page";
lineTwo = "Number: ";
lineTwo.concat(currentPage);
break;
}
this->print(lineOne, lineTwo);
}
@@ -31,7 +47,7 @@ void MenuCaptureRoute::update() {
}
void MenuCaptureRoute::init() {
this->firstPrint = false;
this->setCountPages(4);
this->driveManager->changeModus(Modi::CaptureRoute);
this->captureRoute = (CaptureRoute*) this->driveManager->getDriveModiPtr();
@@ -35,7 +35,7 @@ class MenuCaptureRoute : public MenuDriveMode {
* Changes the DriveModi to CaptureRoute if it is the first time called
* and save the CaptureRoute object.
*/
void printMenu();
void printPage() const override;
/**
* @brief can be called to update shown data
@@ -43,10 +43,9 @@ class MenuCaptureRoute : public MenuDriveMode {
void update() override;
private:
void init();
void init() override;
CaptureRoute* captureRoute;
RouteInfo routeInfo;
};
#endif // MENU_MANUAL_DRIVE_H