refactore all captureRoute stuff

This commit is contained in:
2023-05-11 21:07:21 +02:00
parent 6874aed6ed
commit ed39cdb874
4 changed files with 96 additions and 9 deletions
@@ -12,23 +12,40 @@
void MenuCaptureRoute::printPage() const {
RouteInfo routeInfo = this->captureRoute->getRouteInfo();
uint8_t currentPage = this->getCurrentPage();
String lineOne = "";
String lineTwo = "";
switch (currentPage)
switch (this->getCurrentPage())
{
case 0:
lineOne = "Points: ";
lineOne.concat(routeInfo.totalPoints);
lineTwo = "You can drive.";
lineOne = "Capture Route";
lineTwo = "You can drive";
break;
case 1:
lineOne = "Average distance";
lineTwo = "xxx meters";
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();