- added wifi channel on boot screen

- added wifi to systeminformation
- added accuracy settings to capturee route and autopilot
- fix data loss in calibrate compass
- fix autopilot dont switch to ready for selfdriving
This commit is contained in:
2023-06-02 22:30:21 +02:00
parent 38c8a58988
commit 8796da97b5
12 changed files with 104 additions and 47 deletions
@@ -12,7 +12,7 @@
#include "menuSysteminformation.h"
MenuSysteminformation::MenuSysteminformation(Battery* mainBattery)
: MenuInformationSites(5) {
: MenuInformationSites(6) {
this->mainBattery = mainBattery;
}
@@ -44,6 +44,12 @@ void MenuSysteminformation::printPage() const {
break;
case 4:
lineOne = "Current WiFi";
lineTwo = "channel: ";
lineTwo.concat(Network::getCurrentChannel());
break;
case 5:
lineOne = "Kleiax Rover by";
lineTwo = "Alexander Klein";
break;
@@ -17,6 +17,7 @@
#include "controlPadInput.h"
#include "menuInformationSites.h"
#include "battery.h"
#include "network.h"
/**
* @brief Prints information about the current system status.
@@ -158,6 +158,14 @@ void MenuAutopilot::printPage() const {
lineTwo.concat(" - Decrease");
break;
case 10:
lineOne = "Current minimal";
if (this->driveManager->getNavigation()->getMinAccuracy() >= Point::Accuracy::twoDigOfCM)
lineTwo = "accuracy is high";
else
lineTwo = "accuracy is low";
break;
default:
this->printDefault();
return;
@@ -189,6 +197,13 @@ void MenuAutopilot::runCommand() const {
case 9:
this->minDistance = this->driveManager->getNavigation()->decreaseMinDistanceToReachPoint();
break;
case 10:
if (this->driveManager->getNavigation()->getMinAccuracy() >= Point::Accuracy::twoDigOfCM)
this->driveManager->getNavigation()->setMinAccuracy(Point::Accuracy::none);
else
this->driveManager->getNavigation()->setMinAccuracy(Point::Accuracy::twoDigOfCM);
break;
default:
break;
@@ -204,7 +219,7 @@ void MenuAutopilot::update() {
}
void MenuAutopilot::init() {
this->setCountPages(10);
this->setCountPages(11);
this->driveManager->changeModus(Modi::Autopilot);
this->autopilot = (Autopilot*) this->driveManager->getDriveModiPtr();
this->routeInfo = this->autopilot->getRouteInfo();
@@ -77,20 +77,25 @@ void MenuCalibrateCompass::printPage() const {
break;
case 7:
lineOne = "Reset for new";
lineTwo = "calibration run";
break;
case 8:
lineOne = "X min: ";
lineOne.concat(this->caliCompass->getCallibrationData().data[0][0]);
lineTwo = "X max: ";
lineTwo.concat(this->caliCompass->getCallibrationData().data[0][1]);
break;
case 8:
case 9:
lineOne = "Y min: ";
lineOne.concat(this->caliCompass->getCallibrationData().data[1][0]);
lineTwo = "Y max: ";
lineTwo.concat(this->caliCompass->getCallibrationData().data[1][1]);
break;
case 9:
case 10:
lineOne = "Z min: ";
lineOne.concat(this->caliCompass->getCallibrationData().data[2][0]);
lineTwo = "Z max: ";
@@ -109,7 +114,7 @@ void MenuCalibrateCompass::init() {
this->firstPrint = false;
this->driveManager->changeModus(Modi::ManualControl);
this->manualControl = (ManualControl*) this->driveManager->getDriveModiPtr();
this->setCountPages(10);
this->setCountPages(11);
this->updateDelay = 500;
}
@@ -125,7 +130,6 @@ void MenuCalibrateCompass::runCommand() const {
case CalibrateCompass::State::Finished:
this->manualControl->setCalibrateCompass();
this->caliCompass->useData();
this->caliCompass->reset();
break;
default:
@@ -147,7 +151,11 @@ void MenuCalibrateCompass::runCommand() const {
case 6:
this->caliCompass->useData();
break;
break;
case 7:
this->caliCompass->reset();
break;
default:
break;
@@ -91,6 +91,14 @@ void MenuCaptureRoute::printPage() const {
else
lineOne.concat("0");
break;
case 7:
lineOne = "Current minimal";
if (this->driveManager->getNavigation()->getMinAccuracy() >= Point::Accuracy::twoDigOfCM)
lineTwo = "accuracy is high";
else
lineTwo = "accuracy is low";
break;
default:
this->printDefault();
@@ -106,8 +114,23 @@ void MenuCaptureRoute::update() {
this->printMenu();
}
void MenuCaptureRoute::runCommand() const {
switch (this->getCurrentPage())
{
case 7:
if (this->driveManager->getNavigation()->getMinAccuracy() >= Point::Accuracy::twoDigOfCM)
this->driveManager->getNavigation()->setMinAccuracy(Point::Accuracy::none);
else
this->driveManager->getNavigation()->setMinAccuracy(Point::Accuracy::twoDigOfCM);
break;
default:
break;
}
}
void MenuCaptureRoute::init() {
this->setCountPages(7);
this->setCountPages(8);
this->updateDelay = 500;
this->driveManager->changeModus(Modi::CaptureRoute);
this->captureRoute = (CaptureRoute*) this->driveManager->getDriveModiPtr();
@@ -42,6 +42,8 @@ class MenuCaptureRoute : public MenuDriveMode {
*/
void update() override;
void runCommand() const override;
private:
void init() override;