floatpump-firmware/Middlewares/floatpump/Inc/Menu_Entry.h

44 lines
886 B
C
Raw Normal View History

2023-01-04 12:22:45 +00:00
//
// Created by robtor on 04.01.23.
//
#ifndef FLOATPUMP_MENU_ENTRY_H
#define FLOATPUMP_MENU_ENTRY_H
#include <Menu_Entry_Type_Delegate.h>
namespace floatpump {
namespace menu {
class Menu_Entry {
public:
Menu_Entry_Type_Delegate *m_type;
Menu_Entry(Menu_Entry_Type_Delegate *type, std::string name) : m_type(type), m_name(name) {};
std::string printLine() {
return m_name + ": " + m_type->toString();
}
void action_press() {
m_type->u_press();
}
void action_increase() {
m_type->u_increase(1);
}
void action_decrease() {
m_type->u_decrease(1);
}
private:
std::string m_name;
};
} // floatpump
} // menu
#endif //FLOATPUMP_MENU_ENTRY_H