AceUtils
0.6.0
Useful Arduino utilties which are too small as separate libraries, but complex enough to be shared among multiple projects, and often have external dependencies to other libraries.
|
A class that helps navigate the hierarchical ModeGroup tree defined by the rootModeGroup
.
More...
#include <ModeNavigator.h>
Public Member Functions | |
ModeNavigator (ModeGroup const *rootModeGroup) | |
Constructor. More... | |
uint8_t | modeId () const |
Return the current mode identifier. | |
void | changeMode () |
Move to the next sibling mode and wrap to 0 if the end is reached. | |
void | changeGroup () |
Alternate between a root group and a child group, going to the first mode of the group. More... | |
A class that helps navigate the hierarchical ModeGroup tree defined by the rootModeGroup
.
Currently, this class supports only a 2-level ModeGroup tree, the rootGroup and the array of childGroups, because that's the navigation needs of my various clocks which use 2 buttons to expose various functionalities without using a menu system. I think a hierarchy with more than 2-levels would require a menu to help users avoid getting lost, so this class currently does not support that. Maybe in the future.
Definition at line 19 of file ModeNavigator.h.
|
inline |
Constructor.
Initialize the navigator using the root ModeGroup.
Definition at line 22 of file ModeNavigator.h.
|
inline |
Alternate between a root group and a child group, going to the first mode of the group.
This class currently supports only a 2-level hierarchy. Supporting an arbitrary number of levels would require keeping a stack of the traversal, which would require memory allocation.
Definition at line 46 of file ModeNavigator.h.