70 lines
1.6 KiB
C++
70 lines
1.6 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();
|
|
|
|
String lineOne = "";
|
|
String lineTwo = "";
|
|
|
|
switch (this->getCurrentPage())
|
|
{
|
|
case 0:
|
|
lineOne = "Capture Route";
|
|
lineTwo = "You can drive";
|
|
break;
|
|
|
|
case 1:
|
|
lineOne = "Saved waypoints";
|
|
lineTwo.concat(routeInfo.totalPoints);
|
|
break;
|
|
|
|
case 2:
|
|
lineOne = "Distance to last";
|
|
lineTwo = "point: ";
|
|
lineTwo.concat(this->captureRoute->getDistanceToLastPoint());
|
|
break;
|
|
|
|
case 3: {
|
|
NTRIPClientStates status = this->driveManager->getNavigation()->getNTRIPClient()->getClientState();
|
|
lineOne = "NTRIP Client is";
|
|
|
|
if (status == NTRIPClientStates::pushData)
|
|
lineTwo = "enabled";
|
|
else if (status == NTRIPClientStates::notAvailable)
|
|
lineTwo = "not available";
|
|
else
|
|
lineTwo = "disabled";
|
|
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();
|
|
|
|
}
|