fix bug in route add akku menu begin with akkuread
This commit is contained in:
@@ -131,4 +131,4 @@ double Navigation::courseTo(Point p1, Point p2) {
|
||||
if (p1.isValid() && p2.isValid())
|
||||
return TinyGPSPlus::courseTo(p1.lat, p1.lon, p2.lat, p2.lon);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
|
||||
#include "route.h"
|
||||
|
||||
// TODO: Delete iostream
|
||||
#include <iostream>
|
||||
|
||||
Route::Route() {
|
||||
|
||||
}
|
||||
@@ -22,16 +25,16 @@ void Route::addPointToRoute(Point point) {
|
||||
Point Route::startRoute() {
|
||||
if (this->points.size() < 1)
|
||||
return Point(0, 0);
|
||||
*this->it = this->points.begin();
|
||||
this->it = this->points.begin();
|
||||
this->currentPoint = 1;
|
||||
return **this->it;
|
||||
return *this->it;
|
||||
}
|
||||
|
||||
Point Route::getNextPoint() {
|
||||
if (*this->it != this->points.end()) {
|
||||
if (this->it != this->points.end()) {
|
||||
this->it++;
|
||||
this->currentPoint++;
|
||||
return **this->it;
|
||||
return *this->it;
|
||||
}
|
||||
else
|
||||
return Point(0, 0);
|
||||
@@ -42,4 +45,4 @@ RouteInfo Route::getRouteInfo() {
|
||||
info.totalPoints = this->points.size();
|
||||
info.currentPoint = this->currentPoint;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ class Route {
|
||||
uint16_t currentPoint = 0;
|
||||
|
||||
std::list<Point> points;
|
||||
std::list<Point>::iterator* it;
|
||||
std::list<Point>::iterator it;
|
||||
|
||||
};
|
||||
|
||||
#endif // ROUTE_H
|
||||
#endif // ROUTE_H
|
||||
|
||||
Reference in New Issue
Block a user