A builder class for configuring and adding an analog menu item.
More...
#include <TcMenuBuilder.h>
A builder class for configuring and adding an analog menu item.
This class facilitates the creation and customization of an analog menu item. It offers a fluent API to define attributes such as offset, divisor, step size, maximum value, and unit for the analog menu item before finalizing its addition to the parent menu structure.
The builder modifies the AnalogMenuInfo properties and the associated AnalogMenuItem object to define the behavior and display characteristics of the item within the menu. The configured item is integrated into the menu hierarchy via the commit operation, returning control to the parent TcMenuBuilder.
- See also
- https://tcmenu.github.io/documentation/arduino-libraries/tc-menu/menu-item-types/analog-menu-item/
◆ offset()
Set the offset of the analog item, the offset is added to the analog value before display. So if you set this to be a negative number, the displayed value will be negative until the raw value hits offset.
- Parameters
-
| offs | the offset value to apply to the analog item |
- Returns
- a reference to the current instance of AnalogItemBuilder for chaining additional configurations
◆ divisor()
Set the divisor of the analog item, I.E this is the fixed point divisor for the analog item. If you select for example 2, this will divide the analog value by 2 before displaying it in halves.
- Parameters
-
- Returns
- a reference to the current instance of AnalogItemBuilder for chaining additional configurations
◆ step()
An optional step size for the analog item, allowing for finer control over the displayed values.
- Parameters
-
- Returns
- a reference to the current instance of AnalogItemBuilder for chaining additional configurations
◆ maxValue()
The maximum value that can be represented, this is the RAW value before divisors or offsets are applied.
- Parameters
-
| maxVal | the maximum value that can be represented |
- Returns
- a reference to the current instance of AnalogItemBuilder for chaining additional configurations
◆ unit()
Set the unit name for the analog item, this is displayed after the value.
- Parameters
-
| unit | the unit name to display |
- Returns
- a reference to the current instance of AnalogItemBuilder for chaining additional configurations
◆ endItem()
Finalizes the configuration of the analog menu item and returns control to the parent menu builder.
This method completes the building process of the analog menu item by finalizing its configuration to the associated AnalogMenuItem and integrates it into the menu structure. It then returns control to the parent TcMenuBuilder to allow for further menu items.
- Returns
- A reference to the parent
TcMenuBuilder instance.
The documentation for this class was generated from the following files: