refactor, added akku menu, finished autopilot menu

This commit is contained in:
2022-02-05 13:46:52 +01:00
parent b4a5814ef1
commit aa9bf99349
19 changed files with 270 additions and 55 deletions
@@ -0,0 +1,40 @@
/**
* @file menuCaptureRoute.cpp
* @author Alexander Klein (alex@kleiax.de)
* @brief
* @version 0.1
* @date 2022-01-31
*
* @copyright Copyright (c) 2022
*
*/
#include "menuCaptureRoute.h"
void MenuCaptureRoute::printMenu() {
if (this->firstPrint)
this->init();
if (this->lcd) {
this->lcd->clear();
this->lcd->setCursor(0, 0);
this->lcd->printf("Points: %u", this->routeInfo.totalPoints);
this->lcd->setCursor(0, 1);
this->lcd->print("du fahren. :-)");
} else
std::cout << "Capture du\n fahren. :-)" << std::endl;
}
void MenuCaptureRoute::update() {
if (!this->captureRoute->shouldUpdate())
return;
this->routeInfo = this->captureRoute->getRouteInfo();
this->printMenu();
}
void MenuCaptureRoute::init() {
this->firstPrint = false;
this->driveManager->changeModus(Modi::CaptureRoute);
this->captureRoute = (CaptureRoute*) this->driveManager->getDriveModiPtr();
this->routeInfo = this->captureRoute->getRouteInfo();
}
@@ -0,0 +1,29 @@
/**
* @file menuCaptureRoute.h
* @author Alexander Klein (alex@kleiax.de)
* @brief
* @version 0.1
* @date 2022-01-31
*
* @copyright Copyright (c) 2022
*
*/
#ifndef MENU_CAPTURE_ROUTE_H
#define MENU_MANUAL_DRIVE_H
#include "SpecialMenus/driveModi/menuDriveMode.h"
class MenuCaptureRoute : public MenuDriveMode {
public:
MenuCaptureRoute(DriveManager* driveManager) : MenuDriveMode(driveManager) {}
void printMenu();
void update();
private:
void init();
CaptureRoute* captureRoute;
RouteInfo routeInfo;
};
#endif // MENU_MANUAL_DRIVE_H