clangtidy corrections part 2
This commit is contained in:
+106
-104
@@ -4,9 +4,9 @@
|
||||
* @brief Contains a classes to handles routes with the user input.
|
||||
* @version 0.1
|
||||
* @date 2022-12-28
|
||||
*
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MENU_ROUTE_H
|
||||
@@ -30,135 +30,137 @@ typedef void (MenuRoute::*DataFunction)(uint8_t);
|
||||
|
||||
/**
|
||||
* @brief MenuActionWrapper to call DataFunctions
|
||||
*
|
||||
*
|
||||
* This class should be used to call importRoute,
|
||||
* exportRoute and clearRoute over the Menu.
|
||||
*/
|
||||
class MenuActionRoute : public MenuActionWrapper {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Action Route object
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction like exportRoute
|
||||
*/
|
||||
MenuActionRoute(MenuRoute* menuRoute, DataFunction dataFunction);
|
||||
class MenuActionRoute : public MenuActionWrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Action Route object
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction like exportRoute
|
||||
*/
|
||||
MenuActionRoute(MenuRoute *menuRoute, DataFunction dataFunction);
|
||||
|
||||
/**
|
||||
* @brief Runs the given DataFunction
|
||||
*/
|
||||
void action() override;
|
||||
/**
|
||||
* @brief Runs the given DataFunction
|
||||
*/
|
||||
void action() override;
|
||||
|
||||
private:
|
||||
MenuRoute* menuRoute;
|
||||
DataFunction dataFunction;
|
||||
private:
|
||||
MenuRoute *menuRoute;
|
||||
DataFunction dataFunction;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Handles routes
|
||||
*
|
||||
* With this menu the user can import, export and delete routes.
|
||||
*
|
||||
* With this menu the user can import, export and delete routes.
|
||||
*/
|
||||
class MenuRoute : public MenuControl {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route object
|
||||
*
|
||||
* @param route
|
||||
*/
|
||||
MenuRoute(Route* route);
|
||||
~MenuRoute();
|
||||
class MenuRoute : public MenuControl
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route object
|
||||
*
|
||||
* @param route
|
||||
*/
|
||||
MenuRoute(Route *route);
|
||||
~MenuRoute();
|
||||
|
||||
/**
|
||||
* @brief Prints the last informations
|
||||
*
|
||||
* On first call this function calls the init function.
|
||||
* On every call this functions call the printMenu function from
|
||||
* the mainMenu of this class.
|
||||
*/
|
||||
void printMenu() override;
|
||||
/**
|
||||
* @brief Prints the last informations
|
||||
*
|
||||
* On first call this function calls the init function.
|
||||
* On every call this functions call the printMenu function from
|
||||
* the mainMenu of this class.
|
||||
*/
|
||||
void printMenu() override;
|
||||
|
||||
/**
|
||||
* @name User Inputs
|
||||
* @brief Inputs given by the parentMenu
|
||||
*/
|
||||
///@{
|
||||
void down() override;
|
||||
void up() override;
|
||||
void right() override;
|
||||
void left() override;
|
||||
void yes() override;
|
||||
void no() override;
|
||||
///@}
|
||||
/**
|
||||
* @name User Inputs
|
||||
* @brief Inputs given by the parentMenu
|
||||
*/
|
||||
///@{
|
||||
void down() override;
|
||||
void up() override;
|
||||
void right() override;
|
||||
void left() override;
|
||||
void yes() override;
|
||||
void no() override;
|
||||
///@}
|
||||
|
||||
/**
|
||||
* @brief Import a Route.
|
||||
*
|
||||
* The functions tries to pull the given route id from the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void importRoute(uint8_t routeNumber);
|
||||
/**
|
||||
* @brief Import a Route.
|
||||
*
|
||||
* The functions tries to pull the given route id from the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void importRoute(uint8_t routeNumber);
|
||||
|
||||
/**
|
||||
* @brief Export a Route.
|
||||
*
|
||||
* The functions tries to push the current route to the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void exportRoute(uint8_t routeNumber);
|
||||
/**
|
||||
* @brief Export a Route.
|
||||
*
|
||||
* The functions tries to push the current route to the RoverApi.
|
||||
*
|
||||
* @param routeNumber id
|
||||
*/
|
||||
void exportRoute(uint8_t routeNumber);
|
||||
|
||||
void deleteRoute(uint8_t routeNumber);
|
||||
void deleteRoute(uint8_t routeNumber);
|
||||
|
||||
/**
|
||||
* @brief Delete the current Route.
|
||||
*
|
||||
* @param none this param is not be used.
|
||||
*/
|
||||
void clearRoute(uint8_t none);
|
||||
|
||||
private:
|
||||
void init();
|
||||
/**
|
||||
* @brief Delete the current Route.
|
||||
*
|
||||
* @param none this param is not be used.
|
||||
*/
|
||||
void clearRoute(uint8_t none);
|
||||
|
||||
Route* route;
|
||||
Menu* mainMenu;
|
||||
private:
|
||||
void init();
|
||||
|
||||
bool isInit = false;
|
||||
bool blockInput = false;
|
||||
Route *route;
|
||||
Menu *mainMenu = nullptr;
|
||||
|
||||
static constexpr uint8_t maxRouteNumber = 100;
|
||||
static constexpr uint16_t httpValidExport = 201;
|
||||
static constexpr uint16_t httpValidImport = 202;
|
||||
static constexpr uint16_t httpValidDelete = 202;
|
||||
bool isInit = false;
|
||||
bool blockInput = false;
|
||||
|
||||
static constexpr uint8_t maxRouteNumber = 100;
|
||||
static constexpr uint16_t httpValidExport = 201;
|
||||
static constexpr uint16_t httpValidImport = 202;
|
||||
static constexpr uint16_t httpValidDelete = 202;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief MenuRouteWrapper to call DataFunctions with numeric user input
|
||||
*
|
||||
*
|
||||
*/
|
||||
class MenuRouteWrapper : public MenuIntInputWrapper {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Wrapper object.
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction
|
||||
*/
|
||||
MenuRouteWrapper(MenuRoute* menuRoute, DataFunction dataFunction);
|
||||
class MenuRouteWrapper : public MenuIntInputWrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Menu Route Wrapper object.
|
||||
*
|
||||
* @param menuRoute
|
||||
* @param dataFunction
|
||||
*/
|
||||
MenuRouteWrapper(MenuRoute *menuRoute, DataFunction dataFunction);
|
||||
|
||||
/**
|
||||
* @brief Calls the given DataFunction.
|
||||
*
|
||||
* @param values The value to be given to the DataFunction.
|
||||
* @param length Number of values, should be 1.
|
||||
*/
|
||||
void action(int16_t* values, uint8_t length) override;
|
||||
/**
|
||||
* @brief Calls the given DataFunction.
|
||||
*
|
||||
* @param values The value to be given to the DataFunction.
|
||||
* @param length Number of values, should be 1.
|
||||
*/
|
||||
void action(int16_t *values, uint8_t length) override;
|
||||
|
||||
private:
|
||||
MenuRoute* menuRoute;
|
||||
DataFunction dataFunction = nullptr;
|
||||
private:
|
||||
MenuRoute *menuRoute;
|
||||
DataFunction dataFunction = nullptr;
|
||||
};
|
||||
|
||||
#endif // MENU_ROUTE_H
|
||||
|
||||
Reference in New Issue
Block a user