fome-fw/firmware/controllers/algo/lcd_menu_tree.h

54 lines
972 B
C
Raw Normal View History

2015-01-06 19:07:46 -08:00
/**
* @file lcd_menu_tree.h
*
* @date Jan 6, 2015
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef CONTROLLERS_ALGO_LCD_MENU_TREE_H_
#define CONTROLLERS_ALGO_LCD_MENU_TREE_H_
typedef enum {
LL_STRING,
LL_VERSION,
LL_CONFIG,
LL_RPM,
LL_CLT_TEMPERATURE,
LL_IAT_TEMPERATURE,
LL_ALGORITHM,
} lcd_line_e;
class MenuItem {
public:
MenuItem(MenuItem * parent, const char *text);
2015-01-07 05:04:24 -08:00
MenuItem(MenuItem * parent, lcd_line_e lcdLine);
2015-01-06 19:07:46 -08:00
const char *text;
lcd_line_e lcdLine;
int index;
// that's upper level menu item
MenuItem *parent;
2015-01-06 20:03:36 -08:00
MenuItem *topOfTheList;
2015-01-06 19:07:46 -08:00
MenuItem *firstChild;
MenuItem *lastChild;
MenuItem *next;
2015-01-07 05:04:24 -08:00
private:
void init(MenuItem * parent);
2015-01-06 19:07:46 -08:00
};
class MenuTree {
public:
MenuTree(MenuItem *root);
void nextItem(void);
2015-01-06 20:03:36 -08:00
void back(void);
void enterSubMenu(void);
2015-01-06 19:07:46 -08:00
void init(MenuItem *first, int linesCount);
MenuItem *root;
int linesCount;
MenuItem *current;
MenuItem *topVisible;
};
#endif /* CONTROLLERS_ALGO_LCD_MENU_TREE_H_ */