clangtidy corrections part 1
This commit is contained in:
@@ -11,27 +11,28 @@
|
||||
|
||||
#include "menuDriveMode.h"
|
||||
|
||||
MenuDriveMode::MenuDriveMode(DriveManager* driveManager) {
|
||||
this->driveManager = driveManager;
|
||||
MenuDriveMode::MenuDriveMode(DriveManager* driveManager)
|
||||
: driveManager {driveManager}
|
||||
{
|
||||
}
|
||||
|
||||
void MenuDriveMode::left() {
|
||||
if (this->activeMenu) {
|
||||
if (this->activeMenu)
|
||||
if (static_cast<bool>(this->activeMenu)) {
|
||||
if (static_cast<bool>(this->activeMenu)) {
|
||||
this->activeMenu->left();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this->firstPrint = true;
|
||||
this->configureOnLeave();
|
||||
if (this->menuSpeed)
|
||||
delete this->menuSpeed;
|
||||
this->driveManager->changeModus();
|
||||
MenuInformationSites::left();
|
||||
}
|
||||
|
||||
void MenuDriveMode::right() {
|
||||
if (this->activeMenu) {
|
||||
if (static_cast<bool>(this->activeMenu)) {
|
||||
this->activeMenu->right();
|
||||
return;
|
||||
}
|
||||
@@ -39,7 +40,7 @@ void MenuDriveMode::right() {
|
||||
}
|
||||
|
||||
void MenuDriveMode::up() {
|
||||
if (this->activeMenu) {
|
||||
if (static_cast<bool>(this->activeMenu)) {
|
||||
this->activeMenu->up();
|
||||
return;
|
||||
}
|
||||
@@ -47,7 +48,7 @@ void MenuDriveMode::up() {
|
||||
}
|
||||
|
||||
void MenuDriveMode::down() {
|
||||
if (this->activeMenu) {
|
||||
if (static_cast<bool>(this->activeMenu)) {
|
||||
this->activeMenu->down();
|
||||
return;
|
||||
}
|
||||
@@ -55,7 +56,7 @@ void MenuDriveMode::down() {
|
||||
}
|
||||
|
||||
void MenuDriveMode::yes() {
|
||||
if (this->activeMenu) {
|
||||
if (static_cast<bool>(this->activeMenu)) {
|
||||
this->activeMenu->yes();
|
||||
return;
|
||||
}
|
||||
@@ -63,7 +64,7 @@ void MenuDriveMode::yes() {
|
||||
}
|
||||
|
||||
void MenuDriveMode::no() {
|
||||
if (this->activeMenu) {
|
||||
if (static_cast<bool>(this->activeMenu)) {
|
||||
this->activeMenu->no();
|
||||
return;
|
||||
}
|
||||
@@ -75,7 +76,7 @@ void MenuDriveMode::prepareReenterMenu() {
|
||||
}
|
||||
|
||||
void MenuDriveMode::printMenu() {
|
||||
if (this->activeMenu) {
|
||||
if (static_cast<bool>(this->activeMenu)) {
|
||||
this->activeMenu->printMenu();
|
||||
return;
|
||||
}
|
||||
@@ -88,11 +89,12 @@ void MenuDriveMode::init() {
|
||||
}
|
||||
|
||||
void MenuDriveMode::activateSpeedMenu() {
|
||||
if (!this->driveManager->isActive())
|
||||
if (!this->driveManager->isActive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
DrivingSpeeds& speeds = this->driveManager->getDriveModiPtr()->getSpeedsRef();
|
||||
MenuIntInput* menu = new MenuIntInput(2, new MenuSpeed(speeds));
|
||||
auto *menu = new MenuIntInput(2, new MenuSpeed(speeds));
|
||||
|
||||
menu->setMinMax(5, UINT8_MAX);
|
||||
menu->setEntry(0, "x m/s e-1", driveManager->getDrivingSpeedsRef().x * 10);
|
||||
@@ -112,8 +114,9 @@ void MenuDriveMode::enterSensorMenu() {
|
||||
}
|
||||
|
||||
void MenuDriveMode::enterMenu() {
|
||||
if (!this->activeMenu)
|
||||
if (!static_cast<bool>(this->activeMenu)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->activeMenu->printMenu();
|
||||
this->activeMenu->setParentMenu(this);
|
||||
|
||||
Reference in New Issue
Block a user