start implementation of routeCache

This commit is contained in:
2024-07-03 09:22:16 +02:00
parent dd304cf787
commit dbb646b5a5
3 changed files with 12 additions and 1 deletions
+1
View File
@@ -38,6 +38,7 @@ Have to:
-> check new distance calculation between points -> check new distance calculation between points
-> check new course calculation between points -> check new course calculation between points
-> menu route data und ui disconnecten -> menu route data und ui disconnecten
-> use routeCache in captureRoute and autopilot
+6
View File
@@ -11,6 +11,8 @@
#include "route.h" #include "route.h"
Route Route::routeCache = Route();
void Route::addPointToRoute(Point point) void Route::addPointToRoute(Point point)
{ {
this->points.push_back(point); this->points.push_back(point);
@@ -99,3 +101,7 @@ RouteInfo Route::getRouteInfo()
info.currentPoint = this->currentPoint; info.currentPoint = this->currentPoint;
return info; return info;
} }
Route& Route::getRouteCache() {
return Route::routeCache;
}
+4
View File
@@ -100,12 +100,16 @@ public:
*/ */
bool getStarted() const { return this->started; } bool getStarted() const { return this->started; }
static Route& getRouteCache();
private: private:
uint16_t currentPoint = 0; uint16_t currentPoint = 0;
bool started = false; bool started = false;
std::list<Point> points; std::list<Point> points;
std::list<Point>::iterator it; std::list<Point>::iterator it;
static Route routeCache;
}; };
#endif // ROUTE_H #endif // ROUTE_H