clangtidy corrections part 2
This commit is contained in:
@@ -4,134 +4,170 @@
|
||||
* @brief Contains an implementation of the class MenuCaptureRoute
|
||||
* @version 0.1
|
||||
* @date 2022-01-31
|
||||
*
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*
|
||||
*/
|
||||
#include "menuCaptureRoute.h"
|
||||
|
||||
void MenuCaptureRoute::printPage() const {
|
||||
RouteInfo routeInfo = this->captureRoute->getRouteInfo();
|
||||
const UBX_NAV_PVT_data_t* gpsData = this->captureRoute->getSensorData()->getGnssData();
|
||||
void MenuCaptureRoute::printPage() const
|
||||
{
|
||||
const RouteInfo routeInfo = this->captureRoute->getRouteInfo();
|
||||
const UBX_NAV_PVT_data_t *gpsData = this->captureRoute->getSensorData()->getGnssData();
|
||||
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
switch (this->getCurrentPage()) {
|
||||
case 0:
|
||||
lineOne = "Capture Route";
|
||||
lineTwo = "You can drive";
|
||||
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 0:
|
||||
lineOne = "Capture Route";
|
||||
lineTwo = "You can drive";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lineOne = "Saved waypoints";
|
||||
lineTwo.concat(routeInfo.totalPoints);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lineOne = "Last status:";
|
||||
switch (this->captureRoute->getLastStatus())
|
||||
{
|
||||
case Navigation::Status::InsufficientAccuracy:
|
||||
lineTwo = "Poor Accuracy";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lineOne = "Saved waypoints";
|
||||
lineTwo.concat(routeInfo.totalPoints);
|
||||
case Navigation::Status::Updated:
|
||||
lineTwo = "Point added";
|
||||
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 Navigation::Status::Unchanged:
|
||||
lineTwo = "Point too close";
|
||||
break;
|
||||
|
||||
default:
|
||||
lineTwo = "---";
|
||||
break;
|
||||
}
|
||||
case Navigation::Status::Unchanged:
|
||||
lineTwo = "Point too close";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
lineOne = "Distance to last";
|
||||
lineTwo = "point: ";
|
||||
lineTwo.concat(this->captureRoute->getDistanceToLastPoint());
|
||||
break;
|
||||
|
||||
case 4: {
|
||||
NTRIPClientStates status = this->captureRoute->getSensorData()->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->captureRoute->getSensorData()->getRealAzimuth());
|
||||
if (gpsData->fixType)
|
||||
lineOne.concat(gpsData->hAcc);
|
||||
else
|
||||
lineOne.concat("0");
|
||||
break;
|
||||
|
||||
case 7:
|
||||
lineOne = "Current minimal";
|
||||
if (this->captureRoute->getNavigation()->getMinAccuracy() >= Point::Accuracy::twoDigOfCM)
|
||||
lineTwo = "accuracy is high";
|
||||
else
|
||||
lineTwo = "accuracy is low";
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
lineTwo = "---";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
lineOne = "Distance to last";
|
||||
lineTwo = "point: ";
|
||||
lineTwo.concat(this->captureRoute->getDistanceToLastPoint());
|
||||
break;
|
||||
|
||||
case 4:
|
||||
{
|
||||
NTRIPClientStates status = this->captureRoute->getSensorData()->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->captureRoute->getSensorData()->getRealAzimuth());
|
||||
if (gpsData->fixType)
|
||||
{
|
||||
lineOne.concat(gpsData->hAcc);
|
||||
}
|
||||
else
|
||||
{
|
||||
lineOne.concat("0");
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
lineOne = "Current minimal";
|
||||
if (this->captureRoute->getNavigation()->getMinAccuracy() >= Point::Accuracy::twoDigOfCM)
|
||||
{
|
||||
lineTwo = "accuracy is high";
|
||||
}
|
||||
else
|
||||
{
|
||||
lineTwo = "accuracy is low";
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
|
||||
void MenuCaptureRoute::update() {
|
||||
void MenuCaptureRoute::update()
|
||||
{
|
||||
if (!this->captureRoute->shouldUpdate())
|
||||
{
|
||||
return;
|
||||
}
|
||||
this->printMenu();
|
||||
}
|
||||
|
||||
void MenuCaptureRoute::runCommand() {
|
||||
void MenuCaptureRoute::runCommand()
|
||||
{
|
||||
switch (this->getCurrentPage())
|
||||
{
|
||||
case 7:
|
||||
if (this->captureRoute->getNavigation()->getMinAccuracy() >= Point::Accuracy::twoDigOfCM)
|
||||
{
|
||||
this->captureRoute->getNavigation()->setMinAccuracy(Point::Accuracy::none);
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
this->captureRoute->getNavigation()->setMinAccuracy(Point::Accuracy::twoDigOfCM);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void MenuCaptureRoute::init() {
|
||||
void MenuCaptureRoute::init()
|
||||
{
|
||||
this->setCountPages(8);
|
||||
this->updateDelay = 500;
|
||||
MenuDriveMode::updateDelay = MenuCaptureRoute::updateDelay;
|
||||
this->captureRoute = new CaptureRoute();
|
||||
this->driveManager->changeModus(this->captureRoute);
|
||||
MenuDriveMode::init();
|
||||
|
||||
Reference in New Issue
Block a user