FEATURE: added execute type menu entry
This commit is contained in:
parent
5420b39dd2
commit
4ba4908f01
34
Middlewares/floatpump/Inc/Menu_Entry_Type_Execute.h
Normal file
34
Middlewares/floatpump/Inc/Menu_Entry_Type_Execute.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
//
|
||||||
|
// Created by robtor on 09.12.22.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef FLOATPUMP_MENU_ENTRY_TYPE_EXECUTE_H
|
||||||
|
#define FLOATPUMP_MENU_ENTRY_TYPE_EXECUTE_H
|
||||||
|
|
||||||
|
#include "Menu_Entry_Type_Delegate.h"
|
||||||
|
|
||||||
|
namespace floatpump::menu {
|
||||||
|
|
||||||
|
class Menu_Entry_Type_Execute : public Menu_Entry_Type_Delegate {
|
||||||
|
public:
|
||||||
|
explicit Menu_Entry_Type_Execute() {};
|
||||||
|
|
||||||
|
std::string toString() override;
|
||||||
|
|
||||||
|
void u_press() override;
|
||||||
|
|
||||||
|
void u_increase(uint16_t steps) override;
|
||||||
|
|
||||||
|
void u_decrease(uint16_t steps) override;
|
||||||
|
|
||||||
|
bool isEntered() override;
|
||||||
|
|
||||||
|
void linkConfig(bool *link);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool *m_state;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // menu
|
||||||
|
|
||||||
|
#endif //FLOATPUMP_MENU_ENTRY_TYPE_EXECUTE_H
|
32
Middlewares/floatpump/Src/Menu_Entry_Type_Execute.cpp
Normal file
32
Middlewares/floatpump/Src/Menu_Entry_Type_Execute.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
//
|
||||||
|
// Created by robtor on 10.01.23.
|
||||||
|
//
|
||||||
|
#include "Menu_Entry_Type_Execute.h"
|
||||||
|
|
||||||
|
namespace floatpump::menu {
|
||||||
|
|
||||||
|
std::string floatpump::menu::Menu_Entry_Type_Execute::toString() {
|
||||||
|
return {(*m_state) ? "[--]" : "[XX]"};
|
||||||
|
}
|
||||||
|
|
||||||
|
void floatpump::menu::Menu_Entry_Type_Execute::u_press() {
|
||||||
|
*m_state = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void floatpump::menu::Menu_Entry_Type_Execute::u_increase(uint16_t steps) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void floatpump::menu::Menu_Entry_Type_Execute::u_decrease(uint16_t steps) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool floatpump::menu::Menu_Entry_Type_Execute::isEntered() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void floatpump::menu::Menu_Entry_Type_Execute::linkConfig(bool *link) {
|
||||||
|
m_state = link;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user