AceUtils  0.5.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.
Public Member Functions | List of all members
ace_utils::mode_group::ModeNavigator Class Reference

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 mode () const
 Return the current mode identifier.
 
void setup ()
 Activate the navigator by setting the mode to be the first mode in the ModeGroup hierarchy. More...
 
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. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ModeNavigator()

ace_utils::mode_group::ModeNavigator::ModeNavigator ( ModeGroup const *  rootModeGroup)
inline

Constructor.

Initialize the navigator using the root ModeGroup.

Definition at line 22 of file ModeNavigator.h.

Member Function Documentation

◆ changeGroup()

void ace_utils::mode_group::ModeNavigator::changeGroup ( )
inline

Alternate between a root group and a child group.

This class currently supports only a 2-level hierarchy.

Definition at line 47 of file ModeNavigator.h.

◆ setup()

void ace_utils::mode_group::ModeNavigator::setup ( )
inline

Activate the navigator by setting the mode to be the first mode in the ModeGroup hierarchy.

It is no longer kModeUnknown.

Definition at line 33 of file ModeNavigator.h.


The documentation for this class was generated from the following file: