DCC-EX Simple Throttle
Simple throttle for a DCC-EX CommandStation
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
UserSelectionInterface Class Referenceabstract

Interface class to abstract user selection actions from physical implementations All physical user selection classes must extend this This allows for the use of physical buttons, rotary encoders, touch screens, and other user interface methods that can move menu selections up and down, and increase or decrease throttle speeds Note if using a rotary encoder, if up is counter clockwise for menu selections, this will also be a decrease in speed, and vice versa for down with clockwise and an increase in speed. More...

#include <UserSelectionInterface.h>

Inheritance diagram for UserSelectionInterface:
Inheritance graph
[legend]

Public Member Functions

virtual void begin ()=0
 Implement this to perform any initial startup methods or activities.
 
virtual UserSelectionAction getUserSelectionAction ()=0
 Implement this to check for any user selection actions This should be called at least once per main loop iteration.
 
virtual ~UserSelectionInterface ()=default
 Destructor for the object.
 
bool throttleInverted ()
 Check if throttle is inverted compared to up/down.
 
void setThrottleInverted ()
 Call this method to ensure throttle is inverted compared to selection options.
 

Private Attributes

bool _throttleInverted = false
 

Detailed Description

Interface class to abstract user selection actions from physical implementations All physical user selection classes must extend this This allows for the use of physical buttons, rotary encoders, touch screens, and other user interface methods that can move menu selections up and down, and increase or decrease throttle speeds Note if using a rotary encoder, if up is counter clockwise for menu selections, this will also be a decrease in speed, and vice versa for down with clockwise and an increase in speed.

Constructor & Destructor Documentation

◆ ~UserSelectionInterface()

virtual UserSelectionInterface::~UserSelectionInterface ( )
virtualdefault

Destructor for the object.

Member Function Documentation

◆ begin()

virtual void UserSelectionInterface::begin ( )
pure virtual

Implement this to perform any initial startup methods or activities.

Implemented in RotaryEncoder.

Here is the caller graph for this function:

◆ getUserSelectionAction()

virtual UserSelectionAction UserSelectionInterface::getUserSelectionAction ( )
pure virtual

Implement this to check for any user selection actions This should be called at least once per main loop iteration.

Returns
UserSelectionAction::[None|Up|UpFaster|UpFastest|Down|DownFaster|DownFastest]

Implemented in RotaryEncoder.

Here is the caller graph for this function:

◆ setThrottleInverted()

void UserSelectionInterface::setThrottleInverted ( )
inline

Call this method to ensure throttle is inverted compared to selection options.

Here is the caller graph for this function:

◆ throttleInverted()

bool UserSelectionInterface::throttleInverted ( )
inline

Check if throttle is inverted compared to up/down.

Returns
True if UserSelectionAction::Up decreases speed, and Down increases speed Particularly useful for rotary encoders vs. physical push buttons or touch screens
Here is the caller graph for this function:

Member Data Documentation

◆ _throttleInverted

bool UserSelectionInterface::_throttleInverted = false
private

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