- remove NtripReconnect from Autopilot and CaptureRoute

- shiftet moveControl States in the class namespace
- added auto reconeect to NtripClient
- a lot of refactor
This commit is contained in:
2023-05-30 23:40:05 +02:00
parent 98b65c4aec
commit 22eb6788c3
18 changed files with 369 additions and 280 deletions
@@ -12,44 +12,89 @@
void MenuCaptureRoute::printPage() const {
RouteInfo routeInfo = this->captureRoute->getRouteInfo();
UBX_NAV_PVT_data_t* gpsData = this->driveManager->getNavigation()->getUbxData();
String lineOne = "";
String lineTwo = "";
switch (this->getCurrentPage())
{
case 0:
lineOne = "Capture Route";
lineTwo = "You can drive";
break;
switch (this->getCurrentPage()) {
case 0:
lineOne = "Capture Route";
lineTwo = "You can drive";
break;
case 1:
lineOne = "Saved waypoints";
lineTwo.concat(routeInfo.totalPoints);
break;
case 1:
lineOne = "Saved waypoints";
lineTwo.concat(routeInfo.totalPoints);
break;
case 2:
lineOne = "Distance to last";
lineTwo = "point: ";
lineTwo.concat(this->captureRoute->getDistanceToLastPoint());
break;
case 2:
lineOne = "Last status:";
switch (this->captureRoute->getLastStatus()) {
case Navigation::Status::InsufficientAccuracy:
lineTwo = "Poor Accuracy";
break;
case Navigation::Status::Updated:
lineTwo = "Point added";
break;
case 3: {
NTRIPClientStates status = this->driveManager->getNavigation()->getNTRIPClient()->getClientState();
lineOne = "NTRIP Client is";
case Navigation::Status::Unchanged:
lineTwo = "Point too close";
break;
if (status == NTRIPClientStates::pushData)
lineTwo = "enabled";
else if (status == NTRIPClientStates::notAvailable)
lineTwo = "not available";
else
lineTwo = "disabled";
break;
}
default:
this->printDefault();
return;
default:
lineTwo = "---";
break;
}
break;
case 3:
lineOne = "Distance to last";
lineTwo = "point: ";
lineTwo.concat(this->captureRoute->getDistanceToLastPoint());
break;
case 4: {
NTRIPClientStates status = this->driveManager->getNavigation()->getNTRIPClient()->getClientState();
lineOne = "NTRIP Client is";
if (status == NTRIPClientStates::pushData)
lineTwo = "enabled";
else if (status == NTRIPClientStates::notAvailable)
lineTwo = "not available";
else
lineTwo = "disabled";
break;
}
case 5: {
lineOne = "Carrier Solution";
uint8_t carrSoln = gpsData->flags.bits.carrSoln;
if (carrSoln == 0)
lineTwo = "None";
else if (carrSoln == 1)
lineTwo = "Floating";
else if (carrSoln == 2)
lineTwo = "Fixed";
else
lineTwo = "UNKNOWN";
break;
}
case 6:
lineOne = "hAccuracy: ";
lineTwo = "Azimuth: ";
lineTwo.concat(this->driveManager->getNavigation()->getAzimuth());
if (gpsData->fixType)
lineOne.concat(gpsData->hAcc);
else
lineOne.concat("0");
break;
default:
this->printDefault();
return;
}
this->print(lineOne, lineTwo);
@@ -62,7 +107,8 @@ void MenuCaptureRoute::update() {
}
void MenuCaptureRoute::init() {
this->setCountPages(4);
this->setCountPages(7);
this->updateDelay = 500;
this->driveManager->changeModus(Modi::CaptureRoute);
this->captureRoute = (CaptureRoute*) this->driveManager->getDriveModiPtr();