tcMenu
Public Member Functions | List of all members
FloatMenuItem Class Reference

#include <MenuItems.h>

Inheritance diagram for FloatMenuItem:
MenuItem

Public Member Functions

 FloatMenuItem (const FloatMenuInfo *info, MenuItem *next, bool infoInPgm=INFO_LOCATION_PGM)
 
 FloatMenuItem (const FloatMenuInfo *info, float current, MenuItem *next, bool infoInPgm=INFO_LOCATION_PGM)
 
int getDecimalPlaces () const
 
void setFloatValue (float newVal, bool silent=false)
 
float getFloatValue () const
 
- Public Member Functions inherited from MenuItem
uint8_t copyNameToBuffer (char *sz, int size) const
 
uint8_t copyNameToBuffer (char *sz, int offset, int size) const
 
menuid_t getId () const
 
uint16_t getMaximumValue () const
 
uint16_t getEepromPosition () const
 
MenuType getMenuType () const
 
void triggerCallback () const
 
bool isInfoProgMem () const
 
void setChanged (bool changed)
 
void setChanged (int num, bool changed)
 
bool isChanged (int num=0) const
 
bool isSendRemoteNeeded (uint8_t remoteNo) const
 
void setSendRemoteNeededAll ()
 
void clearSendRemoteNeededAll ()
 
void setSendRemoteNeeded (uint8_t remoteNo, bool needed)
 
void setReadOnly (bool active)
 
bool isReadOnly () const
 
void setLocalOnly (bool localOnly)
 
bool isLocalOnly () const
 
void setSecured (bool secured)
 
bool isSecured () const
 
void setVisible (bool visible)
 
bool isVisible () const
 
MenuItemgetNext () const
 
void setNext (MenuItem *pNext)
 
void changeOccurred (bool silent)
 

Additional Inherited Members

- Protected Member Functions inherited from MenuItem
 MenuItem (MenuType menuType, const AnyMenuInfo *menuInfo, MenuItem *next, bool infoProgMem)
 
- Protected Attributes inherited from MenuItem
uint16_t flags
 
MenuItemnext
 
const AnyMenuInfoinfo = nullptr
 
RuntimeRenderingFn renderFn = nullptr
 
MenuType menuType
 

Detailed Description

FloatMenuItem is for situations where absolute accuracy of the value is not important, for example showing a calculated value from some sensors.

See also
FloatMenuInfo

Constructor & Destructor Documentation

◆ FloatMenuItem() [1/2]

FloatMenuItem::FloatMenuItem ( const FloatMenuInfo info,
MenuItem next,
bool  infoInPgm = INFO_LOCATION_PGM 
)
inline

Create an instance of the class

Parameters
infoa FloatMenuInfo structure
nextthe next menu in the chain if there is one, or NULL.
infoInPgmif the info block is in program memory

◆ FloatMenuItem() [2/2]

FloatMenuItem::FloatMenuItem ( const FloatMenuInfo info,
float  current,
MenuItem next,
bool  infoInPgm = INFO_LOCATION_PGM 
)
inline

Create an instance of the class setting the default value.

Parameters
infoa FloatMenuInfo structure
currentcurrent value as a float
nextthe next menu in the chain if there is one, or NULL.
infoInPgmif the info block is in program memory

Member Function Documentation

◆ getDecimalPlaces()

int FloatMenuItem::getDecimalPlaces ( ) const

return the number of decimal places to display for this value

◆ setFloatValue()

void FloatMenuItem::setFloatValue ( float  newVal,
bool  silent = false 
)

Set the floating point value and mark as changed

◆ getFloatValue()

float FloatMenuItem::getFloatValue ( ) const
inline

Get the current floating point value


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