clangtidy corrections part 1
This commit is contained in:
@@ -4,44 +4,46 @@
|
||||
* @brief Implementation of the class DriveManager
|
||||
* @version 0.1
|
||||
* @date 2021-12-14
|
||||
*
|
||||
*
|
||||
* @copyright Copyright (c) 2021
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "driveModi/driveManager.h"
|
||||
|
||||
DriveManager::DriveManager(MoveControl *moveControl, const SensorData* sensorData, const ControlPadInput *input) {
|
||||
this->driveModiParams.input = input;
|
||||
this->driveModiParams.moveControl = moveControl;
|
||||
this->driveModiParams.sensorData = sensorData;
|
||||
|
||||
DriveManager::DriveManager(MoveControl *moveControl, const SensorData *sensorData, const ControlPadInput *input)
|
||||
: driveModiParams{moveControl, input, sensorData}
|
||||
{
|
||||
this->init();
|
||||
}
|
||||
|
||||
DriveManager::DriveManager(DriveModiParams params){
|
||||
this->driveModiParams = params;
|
||||
|
||||
DriveManager::DriveManager(DriveModiParams params)
|
||||
: driveModiParams{params}
|
||||
{
|
||||
this->init();
|
||||
}
|
||||
|
||||
void DriveManager::changeModus(DriveModi* modus) {
|
||||
if (this->currentModusPtr) {
|
||||
void DriveManager::changeModus(DriveModi *modus)
|
||||
{
|
||||
if (static_cast<bool>(this->currentModusPtr))
|
||||
{
|
||||
this->removeChildComponent(this->currentModusPtr);
|
||||
delete this->currentModusPtr;
|
||||
this->currentModusPtr = nullptr;
|
||||
}
|
||||
|
||||
|
||||
this->currentModusPtr = modus;
|
||||
|
||||
if (this->currentModusPtr) {
|
||||
if (static_cast<bool>(this->currentModusPtr))
|
||||
{
|
||||
this->currentModusPtr->activate(this->driveModiParams);
|
||||
this->currentModusPtr->setSpeeds(this->drivingSpeeds);
|
||||
this->addChildComponent(this->currentModusPtr);
|
||||
}
|
||||
}
|
||||
|
||||
void DriveManager::init() {
|
||||
void DriveManager::init()
|
||||
{
|
||||
this->addChildComponent(this->driveModiParams.moveControl);
|
||||
this->activateOnlyChilds();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user