doxygen finished

This commit is contained in:
2023-10-12 19:50:10 +02:00
parent db74898b72
commit 5eaeb2749b
39 changed files with 1283 additions and 1019 deletions
+47 -25
View File
@@ -4,9 +4,9 @@
* @brief Contains a virtual class for all Modi
* @version 0.1
* @date 2021-12-14
*
*
* @copyright Copyright (c) 2021
*
*
*/
#ifndef DRIVEMODI_H
@@ -17,42 +17,64 @@
#include "controlPadInput.h"
#include "sensorData.h"
struct DriveModiParams {
MoveControl* moveControl;
const ControlPadInput* input;
const SensorData* sensorData;
/**
* @brief The struct contains all objects needed by a DriveMode
*/
struct DriveModiParams
{
MoveControl *moveControl;
const ControlPadInput *input;
const SensorData *sensorData;
};
/**
* @brief Baseclass to build DriveModi
*
*
* This class must be inherited by other classes which want to be
* act as a DriveModi, because the DriveModi structure uses polymorphism.
*/
class DriveModi : public Component {
public:
virtual ~DriveModi();
class DriveModi : public Component
{
public:
virtual ~DriveModi();
const SensorData* getSensorData() const { return this->sensorData; }
const SensorData *getSensorData() const { return this->sensorData; }
void activate(MoveControl* moveControl, ControlPadInput* input, SensorData* sensorData);
void activate(DriveModiParams params);
/**
* @brief This activates a DriveMode
*
* This function have to be called to provide the DriveMode
* with this objects
*
* @param moveControl
* @param input
* @param sensorData
*/
void activate(MoveControl *moveControl, ControlPadInput *input, SensorData *sensorData);
void activate(DriveModiParams params);
void setSpeeds(DrivingSpeeds speeds) { this->maxSpeeds = speeds; }
DrivingSpeeds getSpeeds() const { return this->maxSpeeds; }
DrivingSpeeds& getSpeedsRef() { return this->maxSpeeds; }
void setSpeeds(DrivingSpeeds speeds) { this->maxSpeeds = speeds; }
DrivingSpeeds getSpeeds() const { return this->maxSpeeds; }
DrivingSpeeds &getSpeedsRef() { return this->maxSpeeds; }
protected:
virtual void afterActivate() {}
protected:
/**
* @brief Prepare other things
*
* This function can be overwritten to prepare things
* for the specific DriveModi. This function will be
* called after activate().
*/
virtual void afterActivate() {}
MoveControl *moveControl = nullptr;
DrivingSpeeds maxSpeeds = {1, 7};
const ControlPadInput* input = nullptr;
const SensorData* sensorData = nullptr;
MoveControl *moveControl = nullptr;
DrivingSpeeds maxSpeeds = {1, 7};
const ControlPadInput *input = nullptr;
const SensorData *sensorData = nullptr;
private:
void init();
private:
void init();
static constexpr uint8_t defaultDelay = 40;
static constexpr uint8_t defaultDelay = 40;
};
#endif // DRIVEMODI_H