Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otTextUI Class Reference
[User Interface based on formatted text, User Interface based on formatted text]

User Interface based on formatted text.

#include <otTextUI.h>

Inheritance diagram for otTextUI:

otLCD

Public Types

enum  DisplayType { LCD_TEXT_20X4 }
enum  KeyCode {
  KEY_RET = 0x8001, KEY_ESCAPE = 0x8002, KEY_BACKSPACE = 0x8003, KEY_DEL = 0x8004,
  KEY_LEFT = 0x8005, KEY_RIGHT = 0x8006, KEY_UP = 0x8007, KEY_DOWN = 0x8008,
  KEY_F1 = 0x8009, KEY_F2 = 0x800A, KEY_F3 = 0x800B, KEY_F4 = 0x800C,
  KEY_PLUS_MINUS = 0x800D, KEY_MUL_DIV = 0x800E, KEY_0 = 15, KEY_1 = 16,
  KEY_2 = 17, KEY_3 = 18, KEY_4 = 19, KEY_5 = 20,
  KEY_6 = 21, KEY_7 = 22, KEY_8 = 23, KEY_9 = 24
}
enum  Actions { U_REFRESH = 32768, U_INC = 32769, U_DEC = 32770 }
enum  Attribute { A_DISPLAY = 0, A_NUMBER = 1, A_MENU = 2, A_TEXT = 3 }
enum  VarTypes {
  V_INT, V_UNSIGNED, V_DOUBLE, V_STRING,
  V_U8, V_S8, V_U16, V_S16,
  V_F32
}

Public Member Functions

 otTextUI ()
void init (keyScanMethod key, U8 pAdd=0x27)
void panel (const char *master, const char *helpSrc, U8 helpDisplaySize)
void panelVariables (int par,...)
U32 panelVarAttribute (U8 attribute, U32 varCount,...)
void panelVarChangeType (U8 newType, U32 varCount,...)
void panelMenuSetup (const char *menuText[], U32 menuItems, U32 selected)
void panelMenuDisplay (const char *menuText[], U32 selected)
S32 panelMenuSelection (const char *menuText[])
void panelUpdate (U16 upDwn)
bool update (const char *dsp)
void stringRotate (U8 page=0)
void stringsRotate ()
void slidingText (const char *helpSrc, U8 helpDisplaySize, U8 page)
void slidingTextIndex (U8 page=0)
void setScancode (U16 who, U16 val)
U32 edit ()
U32 menu (U32 items, const char *title, const char *menuText[])
U8 * progressPtr ()
U8 * progressOpen (U32 numOfChars)
void progressRange (U32 minValue, U32 maxValue)
void progressClear ()
void progressValue (U32 value)
U16 getKey (bool release)
char * help (U8 page=0)
void setHelp (U8 page, const char *helpText, U16 size)

Member Enumeration Documentation

enum otTextUI::Actions
 

Enumeration values:
U_REFRESH  Update display.
U_INC  Scroll up.
U_DEC  Scroll down.

enum otTextUI::Attribute
 

Enumeration values:
A_DISPLAY  Display only.
A_NUMBER  Input for numbers.
A_MENU  Menu selection.
A_TEXT  Text input.

enum otTextUI::DisplayType
 

Enumeration values:
LCD_TEXT_20X4  20x4 LCD

enum otTextUI::KeyCode
 

Enumeration values:
KEY_RET  Key codes.
KEY_ESCAPE 
KEY_BACKSPACE 
KEY_DEL 
KEY_LEFT 
KEY_RIGHT 
KEY_UP 
KEY_DOWN 
KEY_F1 
KEY_F2 
KEY_F3 
KEY_F4 
KEY_PLUS_MINUS 
KEY_MUL_DIV 
KEY_0 
KEY_1 
KEY_2 
KEY_3 
KEY_4 
KEY_5 
KEY_6 
KEY_7 
KEY_8 
KEY_9 

enum otTextUI::VarTypes
 

Enumeration values:
V_INT  32 bit signed integer, default type for signed integers
V_UNSIGNED  32 bit unsigned integer, default type for unsigned integers
V_DOUBLE  64 bit double floating point, default floating point
V_STRING  8 bit signed -> string, default text
V_U8  8 bit unsigned
V_S8  8 bit signed
V_U16  16 bit unsigned
V_S16  16 bit signed
V_F32  32 bit floating point


Constructor & Destructor Documentation

otTextUI.otTextUI (   ) 
 

Create the class


Member Function Documentation

U32 otTextUI.edit (   ) 
 

In the EDIT mode it is possible to modify all the variables belonging to the panel that can be modified. These are the commands associated with the various keys:

  • The up/down arrows select the editable variable
  • ESC exits without saving
  • RET closes and saves the edit.
  • BCKSP delete previous character
  • DEL delete next character, but in the case of a menu BCKSP and DEL change the selection.
  • 0..9,A..Z available characters
  • F1 selects the first alternating character (if any), F2 the second ... and so on.
    Returns:
    Last key pressed

U16 otTextUI.getKey (  bool  release  ) 
 

Get a key

Parameters:
release True if wait the release of pressed key
Returns:
Keycode or 0 if not pressed

char* otTextUI.help (  U8  page = 0  ) 
 

Return the address of an help page

Parameters:
page Page index 0 .. 3
Returns:
Help data address

void otTextUI.init (  keyScanMethod  key,
U8  pAdd = 0x27
) 
 

Init the class

Parameters:
key Callback to a function that scan a keyboard
pAdd Address of LCD interface (PCF8574)

U32 otTextUI.menu (  U32  items,
const char *  title,
const char *  menuText[]
) 
 

Create a menu

Parameters:
items Number of menu items
title Menu title
menuText Menu string source
Returns:
Selected item index

void otTextUI.panel (  const char *  master,
const char *  helpSrc,
U8  helpDisplaySize
) 
 

Create a panel from a string definition.

Parameters:
master Pointer to a string that define a panel
helpSrc Pointer to contextual help
helpDisplaySize Contextual help size

void otTextUI.panelMenuDisplay (  const char *  menuText[],
U32  selected
) 
 

Select an item in the menu defined in a panel

Parameters:
menuText Address of a defined menu
selected Index of selected item in the menu

S32 otTextUI.panelMenuSelection (  const char *  menuText[]  ) 
 

Return selected item in the menu efined in a panel

Parameters:
menuText Address of a defined menu
Returns:
Selected item index

void otTextUI.panelMenuSetup (  const char *  menuText[],
U32  menuItems,
U32  selected
) 
 

Create a menu in the panel

Parameters:
menuText Menu definition
menuItems Number of items in the menu
selected Index of selected item in the menu

void otTextUI.panelUpdate (  U16  upDwn  ) 
 

Update display (LCD) contents

Parameters:
upDwn Desidered action, see Actions

U32 otTextUI.panelVarAttribute (  U8  attribute,
U32  varCount,
  ...
) 
 

Specify an attribute for a used variable in the panel. As default a variable can't be edited or changed, with this command you can change this setting

Parameters:
attribute Used attribute for the listed variables, see Attribute
varCount Number of listed variables
... List of variable address

void otTextUI.panelVarChangeType (  U8  newType,
U32  varCount,
  ...
) 
 

Default variable type are: V_INT and V_UNSIGNED for 32 bit integer; V_DOUBLE for 64 bit floating point; V_STRING for string. With this function you can change a default type to a different.

Parameters:
newType Variable type see VarTypes
varCount Number of listed variables
... List of variable address

void otTextUI.panelVariables (  int  par,
  ...
) 
 

Create an association between panel field and a variable

Parameters:
par Number of variables
... List of variable pointers

void otTextUI.progressClear (   ) 
 

Clear progress bar

U8* otTextUI.progressOpen (  U32  numOfChars  ) 
 

Create a progress bar

Parameters:
numOfChars Number of characters used for the progress bar, max 20
Returns:
Progress data pointer

U8* otTextUI.progressPtr (   ) 
 

Return pointer to progress data

Returns:
Progress data pointer

void otTextUI.progressRange (  U32  minValue,
U32  maxValue
) 
 

Set the operating progress range

Parameters:
minValue Minimum value
maxValue Maximu value

void otTextUI.progressValue (  U32  value  ) 
 

Set current value of the progress bar

Parameters:
value Current value of progress bar in the range specified by minValue and maxValue specified with progressRange

void otTextUI.setHelp (  U8  page,
const char *  helpText,
U16  size
) 
 

Set an help page

Parameters:
page Page index 0 .. 3
helpText Help text
size Number of displayed character of this help

void otTextUI.setScancode (  U16  who,
U16  val
) 
 

Define a scan code associated to a specific KEY

Parameters:
who Key definition, see KeyCode
val Scancode

void otTextUI.slidingText (  const char *  helpSrc,
U8  helpDisplaySize,
U8  page
) 
 

void otTextUI.slidingTextIndex (  U8  page = 0  ) 
 

void otTextUI.stringRotate (  U8  page = 0  ) 
 

Rotate a defined string in the panel.

	 *            ______________________\n
	 * STRING TO [ DISPLAY IS VERY LONG ] ABOVE DISPLAY SIZE\n
	 *            ---------------------- \n
	 * 
Parameters:
page Page index 0 .. 3

void otTextUI.stringsRotate (   ) 
 

Rotate all defined string in the panel

bool otTextUI.update (  const char *  dsp  ) 
 

Copy a string into display. String size must be below 20x4 ...

Parameters:
dsp String to display
Returns:
True on success


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-25 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0