bug fixes

This commit is contained in:
2023-01-04 00:17:39 +01:00
parent 51ba70e297
commit 15689bf56b
5 changed files with 25 additions and 13 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
* around the half accuracy of the positioning system
*
*/
#define MIN_DISTANCE_BETWEEN_POINTS 1
#define MIN_DISTANCE_BETWEEN_POINTS 0.1
/**
* @brief This struct inherits the result of the navigation
+21 -8
View File
@@ -13,6 +13,9 @@
MenuRoutePoints::MenuRoutePoints(Route *route) : MenuInformationSites() {
this->route = route;
}
void MenuRoutePoints::init() {
uint16_t amountPoints = this->route->getRouteInfo().totalPoints;
if (amountPoints > UINT8_MAX)
this->error = true;
@@ -21,8 +24,12 @@ MenuRoutePoints::MenuRoutePoints(Route *route) : MenuInformationSites() {
}
void MenuRoutePoints::printPage() const {
String lineOne = "N";
String lineTwo = "E";
uint8_t currentPage = this->getCurrentPage();
if (this->lastPageNumber == currentPage)
return;
String lineOne = "N ";
String lineTwo = "E ";
if (this->error) {
lineOne = "Error: To much";
@@ -40,24 +47,30 @@ void MenuRoutePoints::printPage() const {
}
Point p;
uint8_t currentPage = this->getCurrentPage();
if (currentPage == 0)
p = this->route->startRoute();
else if (currentPage == this->getCountPages())
p = this->route->endRoute();
else if (this->lastPageNumber - 1 == currentPage)
p = this->route->getPreviousPoint();
else if (this->lastPageNumber + 1 == currentPage)
p = this->route->getNextPoint();
else if (currentPage == this->getCountPages() - 1)
p = this->route->endRoute();
else
std::cout << "Error in: MenuRoutePoints::printPage()" << std::endl;
lineOne.concat(p.getLatitude());
char buf[20];
char* string;
info = this->route->getRouteInfo();
string = dtostrf(p.getLatitude(), 9, 7, buf);
lineOne.concat(string);
lineOne.concat(" ");
lineOne.concat(info.currentPoint);
lineTwo.concat(p.getLongitude());
// lineOne.concat(currentPage);
string = dtostrf(p.getLongitude(), 9, 7, buf);
lineTwo.concat(string);
lineTwo.concat(" ");
lineTwo.concat(info.totalPoints);
// std::cout << "MenuRoutePoints::printPage currentPage: " << (int) currentPage << std::endl;
this->print(lineOne, lineTwo);
}
+1 -1
View File
@@ -19,12 +19,12 @@
class MenuRoutePoints : public MenuInformationSites {
public:
MenuRoutePoints(Route *route);
void init () override;
void printPage() const override;
private:
Route* route;
uint8_t lastPageNumber = 0;
bool error = false;
};
@@ -29,6 +29,7 @@ void MenuSysteminformation::printPage() const {
case 1:
lineOne = "Max alloc heap:";
lineTwo.concat(ESP.getMaxAllocHeap());
break;
case 2:
lineOne = "Uptime in secs:";
@@ -59,9 +59,7 @@ void MenuAutopilot::printMenu() {
sprintf(buf2, "vorhanden.");
}
}
if (!navigationStarted && !navigationEnded){
}
if (this->lcd) {
this->lcd->clear();
this->lcd->setCursor(0, 0);