doxygen finished
This commit is contained in:
+47
-25
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user