53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
/**
|
|
* @file menuCaptureRoute.cpp
|
|
* @author Alexander Klein (alex@kleiax.de)
|
|
* @brief Contains an implementation of the class MenuCaptureRoute
|
|
* @version 0.1
|
|
* @date 2022-01-31
|
|
*
|
|
* @copyright Copyright (c) 2022
|
|
*
|
|
*/
|
|
#include "menuCaptureRoute.h"
|
|
|
|
void MenuCaptureRoute::printPage() const {
|
|
RouteInfo routeInfo = this->captureRoute->getRouteInfo();
|
|
uint8_t currentPage = this->getCurrentPage();
|
|
|
|
String lineOne = "";
|
|
String lineTwo = "";
|
|
|
|
switch (currentPage)
|
|
{
|
|
case 0:
|
|
lineOne = "Points: ";
|
|
lineOne.concat(routeInfo.totalPoints);
|
|
lineTwo = "You can drive.";
|
|
break;
|
|
|
|
case 1:
|
|
lineOne = "Average distance";
|
|
lineTwo = "xxx meters";
|
|
break;
|
|
|
|
default:
|
|
this->printDefault();
|
|
return;
|
|
}
|
|
|
|
this->print(lineOne, lineTwo);
|
|
}
|
|
|
|
void MenuCaptureRoute::update() {
|
|
if (!this->captureRoute->shouldUpdate())
|
|
return;
|
|
this->printMenu();
|
|
}
|
|
|
|
void MenuCaptureRoute::init() {
|
|
this->setCountPages(4);
|
|
this->driveManager->changeModus(Modi::CaptureRoute);
|
|
this->captureRoute = (CaptureRoute*) this->driveManager->getDriveModiPtr();
|
|
|
|
}
|