tcMenuJavaAPI
Public Member Functions | List of all members
com.thecoderscorner.menu.domain.AnalogMenuItem Class Reference
Inheritance diagram for com.thecoderscorner.menu.domain.AnalogMenuItem:
com.thecoderscorner.menu.domain.MenuItem

Public Member Functions

 AnalogMenuItem (String name, String variableName, int id, int eepromAddress, String functionName, int maxValue, int offset, int divisor, int step, String unitName, boolean readOnly, boolean localOnly, boolean visible, boolean staticInRAM)
 
int getMaxValue ()
 
int getOffset ()
 
int getDivisor ()
 
int getStep ()
 
String getUnitName ()
 
void accept (MenuItemVisitor visitor)
 
boolean equals (Object o)
 
int hashCode ()
 
- Public Member Functions inherited from com.thecoderscorner.menu.domain.MenuItem
 MenuItem (String name, String variableName, int id, int eepromAddress, String functionName, boolean readOnly, boolean localOnly, boolean visible, boolean staticDataInRAM)
 
String getName ()
 
boolean isReadOnly ()
 
int getId ()
 
boolean isLocalOnly ()
 
int getEepromAddress ()
 
String getFunctionName ()
 
String getVariableName ()
 
boolean isVisible ()
 
boolean hasChildren ()
 
boolean isStaticDataInRAM ()
 
String toString ()
 

Additional Inherited Members

- Protected Attributes inherited from com.thecoderscorner.menu.domain.MenuItem
final String name
 
final String variableName
 
final int id
 
final int eepromAddress
 
final String functionName
 
final boolean readOnly
 
final boolean localOnly
 
final boolean visible
 
final boolean staticDataInRAM
 

Detailed Description

Represents an analog (numeric) menu item, it is always a zero based integer when retrieved from storage, but it can have an offset and divisor, so therefore is able to represent decimal values. The offset can also be negative. Step allows the rate of change to be greater than 1 unit, but must be an exact divisor of the maximum value. Rather than directly constructing an item of this type, you can use the AnalogMenuItemBuilder.

Member Function Documentation

◆ accept()

void com.thecoderscorner.menu.domain.AnalogMenuItem.accept ( MenuItemVisitor  visitor)

See the MenuItemVisitor for more info.

Parameters
visitorthe item to be visited.

Reimplemented from com.thecoderscorner.menu.domain.MenuItem.

◆ getDivisor()

int com.thecoderscorner.menu.domain.AnalogMenuItem.getDivisor ( )

The divisor used when displaying the item, for example value 50 with a divisor of 10 is 5.0

Returns
the divisor used

◆ getMaxValue()

int com.thecoderscorner.menu.domain.AnalogMenuItem.getMaxValue ( )

The maximum value (0 based integer) that this item can represent

Returns
max value

◆ getOffset()

int com.thecoderscorner.menu.domain.AnalogMenuItem.getOffset ( )

The offset from 0 that is used when displaying the item, can be negative

Returns
the offset

◆ getStep()

int com.thecoderscorner.menu.domain.AnalogMenuItem.getStep ( )

The step is the amount by which each increment should increase the value, it must be exactly divisible by the maximum value. Default is 1 and the value can never be lower than 1.

Returns
the current step

◆ getUnitName()

String com.thecoderscorner.menu.domain.AnalogMenuItem.getUnitName ( )

The unit name to appear directly after the value, for example a temperature item may be "oC" where as a volume control could be "dB"

Returns
the name of the unit (if any)

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