Release 1.01
Diff: Menu.h
- Revision:
- 4:7226c43320b5
- Parent:
- 3:8395f7ab6d3e
- Child:
- 5:9f4d4f8ffc00
--- a/Menu.h Thu Jul 25 00:42:49 2019 +0000 +++ b/Menu.h Thu Sep 12 11:27:50 2019 +0000 @@ -2,43 +2,53 @@ #define MENU_H #include "mbed.h" -#include "Selection.h" #include "LCD.h" #include <vector> #include <string> -class Selection; class Menu { private: + + Mutex display_mutex; public: + static Menu * currentMenu; + static Menu * getCurrentMenu () ; + static Menu * setCurrentMenu (Menu * value) ; LCD * lcd; - Menu * parent; + int update_needed; - int cursorPos; // what selection the cursor points to + int selectedMenu; // what selection the cursor points to + int cursorLine; // what line of the lcd the cursor is one + int cursorIndex; // what line of the lcd the cursor is one - vector<Selection> selections; - string menuID; + Menu * parent; + + vector<Menu*> children; + + char* menuID; Menu(char *id); - Menu(string id); + + void add( Menu *submenu); - - - void add(const Selection &toAdd); + virtual void init(); + virtual void select(); + virtual void back(); - virtual void select(); + virtual char* getText() { return "Main"; } - //char * getText() { return menuID.c_str(); }; - + virtual void DrawDisplay(LCD * lcd); virtual void display(LCD * lcd); - + void displayCurrentTime (LCD * lcd); + void displayVersion (LCD * lcd); + void moveUp(); void moveDown(); @@ -48,8 +58,8 @@ virtual void pressDown(); virtual void pressUp(); - void printMenu(); - void printCursor(); + virtual void lock() { display_mutex.lock();} + virtual void unlock() { display_mutex.unlock();} }; #endif \ No newline at end of file