53 lines
687 B
C++
53 lines
687 B
C++
#ifndef MENU_H
|
|
#define MENU_H
|
|
|
|
#include <Arduino.h>
|
|
|
|
enum MenuType {
|
|
MENU_MAIN,
|
|
MENU_SETUP,
|
|
};
|
|
|
|
enum MenuState {
|
|
STATE_BROWSING,
|
|
STATE_EDITING
|
|
};
|
|
|
|
class Menu {
|
|
private:
|
|
MenuType type;
|
|
MenuState state;
|
|
|
|
int index;
|
|
|
|
// Settings
|
|
int targetTemperature;
|
|
int targetHumidity;
|
|
|
|
static const int MAIN_SIZE = 3;
|
|
static const int SETUP_SIZE = 3;
|
|
|
|
const char* getItem(MenuType type, int index);
|
|
int getSize(MenuType type);
|
|
|
|
public:
|
|
Menu();
|
|
|
|
void next();
|
|
void prev();
|
|
|
|
void enter();
|
|
void back();
|
|
|
|
const char* getCurrent();
|
|
const char* getNext();
|
|
|
|
MenuType getType();
|
|
|
|
bool isEditing();
|
|
|
|
int getTargetTemperature();
|
|
int getTargetHumidity();
|
|
};
|
|
|
|
#endif |