INOS
CINOSSioTftExp Class Reference

Main inco explorer class for TFT display. More...

#include <cinossiotftexp.h>

Inheritance diagram for CINOSSioTftExp:

Public Member Functions

 CINOSSioTftExp (const char *acName, CINOSSioTft *apDisplay, const char *acConfig)
 Constructor.
 
virtual ~CINOSSioTftExp ()
 Destructor.
 
void SelLanguage (uint32 auLangIndex)
 Select language to display.
 
uint32 GetLanguage ()
 Get selected language to display.
 
const charGetLangFileName (uint32 auLangIndex) const
 Check if language file by index available.
 
void SetUserLevel (uint32 auLevel)
 Set user level.
 
void GetActualTab (char *apTab, uint32 auLength, bool abFullPath=false)
 Get currently selected tab.
 
void SetActualTab (char *apTab)
 Set current tab.
 
void GetActualVar (char *apVar, uint32 auLength)
 Get default name of currently selected variable.
 
void GetActualVarLang (char *apVar, uint32 auLength)
 Get actual selected variable in selected language.
 
void GetActualVarValue (char *apVal, uint32 auLength)
 Get value of actual selected variable.
 
bool UpdateInco ()
 Update inco item pointers of items e.g. after new registrations.
 
bool RepaintNeeded ()
 
void Refresh ()
 
void HardCopy (int16 aiXX1=-1, int16 aiYY1=-1, int16 aiXX2=-1, int16 aiYY2=-1, bool abUseRLE=true)
 
uint32 GetPressedKeys ()
 Get pattern of pressed user keys (matrix).
 
uint32 GetFlags ()
 Get internal flags (e.g. shift mode).
 
CINOSSioTftExpTabGetTopTab () const
 To get the top tab pointer.
 
void EnableRefresh (bool abRefresh)
 
void SetTabCharacteristics (const char *const acTabPath, uint32 auCharacteristics, ETFTCharCmd aeCmd)
 Set (add/remove) characteristics of a tab.
 
bool SetVarCharacteristics (const char *const acVarPath, uint32 auCharacteristics, ETFTCharCmd aeCmd)
 Set (add/remove) characteristics of a variable.
 
bool SetProcCharacteristics (const char *const acPath, uint32 auCharacteristics, ETFTCharCmd aeCmd)
 
void Reset ()
 Manually reset display.
 
void SetInitDoneCallback (InitDoneFunc callback, void *apContext)
 Register callback for notification about when the explorer is completely initialized.
 
void SetTabChangeCallback (OnTabChangeFunc callback, void *apContext)
 Register callback for tab change notification.
 
- Public Member Functions inherited from CINOSTask
 CINOSTask (char *apName=nullptr, uint32 auStackSize=defDefaultStackSize, uint32 auPriority=DF_INOS_TASK_PRIO_LOWEST, bool abFloatingPoint=true, uint32 auTimeSlice=defDefaultTimeSlice, bool abInterruptsDisabled=false, void *apHandler=0, void *apObject=0)
 Create a task with given properties. One needs to Resume the task after creation to get it running.
 
 CINOSTask (std::function< void(void *)> aFunction, void *apParam=nullptr, uint8 auPriority=DF_INOS_TASK_PRIO_LOWEST)
 Create a task with given properties. One needs to Resume the task after creation to get it running.
 
 CINOSTask (const char *apName, std::function< void(void *)> aFunction, void *apParam=nullptr, uint8 auPriority=DF_INOS_TASK_PRIO_LOWEST)
 Create a task with given properties. One needs to Resume the task after creation to get it running.
 
virtual ~CINOSTask ()
 Destroy task.
 
virtual uint32 Shutdown (CINOSSync *apSync=DF_INOS_SYNCHRONOUS)
 Shutdown task, used to shutdown a foreign task.
 
virtual uint32 Join ()
 Join task or in other words, wait till it terminates.
 
virtual void Detach ()
 Detach task from parent. One uses this method if one doesn't want this task to be shut down if the parent shuts down.
 
virtual void Exit ()
 Terminate myself. Exit code is INOS_OK or the code previously set with SetExitCode.
 
virtual void Exit (uint32 auExitCode)
 Terminate myself.
 
virtual void SetExitCode (uint32 auExitCode)
 Set exit code.
 
virtual uint32 GetExitCode ()
 Get exit code.
 
virtual bool CheckShutdown ()
 Check if a shutdown is pending.
 
virtual void SetSuspendHook (void *apSuspendHook)
 Set Suspend hook.
 
virtual void ClrSuspendHook ()
 Clear Suspend hook.
 
virtual voidGetSuspendHook ()
 Get Suspend hook if any.
 
INOS_INLINE ETskType GetTskType ()
 Get task type.
 
INOS_INLINE ETskType SetTskType (ETskType aeType)
 Set task type.
 

Static Public Member Functions

static CINOSSioTftExpFind (const char *apExplorer)
 
static void MakeFloatValue (char *apBuf, void *apValue, char acFormat, uint16 auDigits)
 Format float value (for no-float targets).
 
static uint32 ReplaceNewLines (char *apText, uint32 auSize, bool abEscaping)
 Replace '
' in a string with '|' for display, give count of newlines.
 
static void AppendSpaces (char *apText, uint32 auSize)
 Appends spaces to a string to fill the remaining part of the buffer.
 

Static Public Attributes

static CINOSMutex m_mMutex
 Make CINOSSioTftExp thread safe.
 

Protected Member Functions

void Init ()
 Init explorer depending on display size.
 
uint32 GetRows (STFTFontInfo &arInfo)
 Get number of rows for this font.
 
uint32 GetColumns (STFTFontInfo &arInfo)
 Get number of columns for this font.
 
uint32 ShowTab (CINOSSioTftExpTab *apTab, uint32 auLevel)
 Show tab with all elements.
 
uint32 ShowTabFix (CINOSSioTftExpTab *apTab, uint32 auLevel)
 Show tab with all elements.
 
void ShowProcs (CINOSSioTftExpTab *apTab)
 Show procedures of given tab.
 
void ShowProcsFix (CINOSSioTftExpTab *apTab)
 Show procedures of given tab.
 
void ShowVars (uint32 auCoordY, CINOSSioTftExpTab *apTab, bool abNames=false)
 Show vars, values with/without names.
 
void ShowVarsFix (CINOSSioTftExpTab *apTab, bool abNames=false)
 Show vars, values with/without names at fixed positions.
 
void TextOut (uint16 auCoordX, uint16 auCoordY, char *pText, STFTFontInfo &arFontInfo, int16 aiStrLength=-1, uint32 auFlags=0)
 Print a text with given font at given coordinates.
 
void TextOutFix (uint16 auStartCoordX, uint16 auStartCoordY, uint16 auEndCoordX, uint16 auEndCoordY, EBlockTextAlignment aeBlockAlignment, char *apText, STFTFontInfo &arFontInfo, int16 aiStrLength=-1, uint32 auFlags=0)
 
void ResetDisplay ()
 Reset display, necessary after link problems.
 
CINOSSioTftExpGetNext ()
 Get next explorer inlist.
 
void HandleCommands ()
 Handle user commands and display events (key presses).
 
virtual void Action ()
 Main task function.
 
void ActivateFirstChild ()
 Recursively activate the first child of the active tab.
 
void ProcessLangFile (char *apFile)
 Terminate all strings with 0 so they can be used directly.
 
void HandleHardcopy ()
 Handle hardcopy request.
 

Protected Attributes

CINOSSioTftExpm_pNext
 Next explorer in list.
 
CINOSSioTftm_pSioTft
 Pointer to display that outputs all our stuff.
 
CINOSSioTftExpTabm_pTopTab
 Pointer to upmost tab that holds the rest (never displayed).
 
CINOSSioTftExpTabm_pActiveTab
 Pointer to active tab that is shown with variables.
 
CTFTIncoMemberm_pActiveVar
 Pointer to active var that is selected for editing.
 
CINOSSemaphore m_CKeySemaphore
 Semaphore to handle key presses and other actions.
 
const charm_pConfig
 Name of explorer config.
 
uint16 m_uLangCount
 Number of available language files.
 
const char ** m_ppLangFile
 Pointers to processed language file texts.
 
const char ** m_ppLangFileEnd
 Pointers to end of language file texts.
 
const char ** m_ppLangFiles
 Pointers to available language file names.
 
STouchButton m_DefButton
 Default button definition.
 
CINOSSioTftExpTabm_pVisibleTabs [256]
 Mapping of all possible return values to the currently visible tabs.
 
CTFTIncoMemberm_TouchMembers [16]
 
CINOSTime m_ThrobberTime
 Timer for selecting next throbber image.
 
STFTFontInfo m_TabFont
 Font definition for tab buttons.
 
STFTFontInfo m_VarFont
 Font definition for members (variables).
 
STFTFontInfo m_VarFontBig
 Font definition for big members (variables).
 
STFTFontInfo m_ProcFont
 Font definition for procedure buttons.
 
uint16 m_uWidth
 Width of display.
 
uint16 m_uHeight
 Height of display.
 
uint16 m_uTopDivider
 Line of top divider (may be different on every tab).
 
uint16 m_uBottomDivider
 Line of bottom divider.
 
uint8 m_uActLanguage
 Index of actual language.
 
uint8 m_uUserLevel
 User level for editing variables.
 
uint8 m_uVarColumns
 Columns of display.
 
uint8 m_uValueColumn
 Column where values start.
 
uint8 m_uUnitColumn
 Column where units start.
 
uint8 m_uTabBtnSize
 General size for tab buttons.
 
uint8 m_uProcBtnSize
 General size for procedure buttons.
 
uint8 m_uThrobber
 Index of throbber picture.
 
uint8 m_uThrobberSize
 Minimal space required for throbber (excluded from procedures)
 
STFTHardcopy m_HardCopyInstruction
 Hardcopy command settings.
 
uint32 m_uFlags
 General flags.
 
uint32 m_uUserKeys
 Pattern of pressed user (matrix) keys.
 
uint32 m_uTime
 Metering time how much we needed to handle events.
 
const charm_pTFTProject
 The name of the display project.
 
const charm_pMacroFile
 The name of the macro file containing display bitmaps, fonts etc.
 
InitDoneFunc m_pInitDoneCallback
 Callback for init done notification.
 
voidm_pInitDoneContext
 Context for init done notification.
 
OnTabChangeFunc m_pTabChangeCallback
 Callback for init done notification.
 
voidm_pTabChangeContext
 Context for init done notification.
 

Static Protected Attributes

static CINOSSioTftExpm_pFirst
 Start of linked list of explorers.
 

Friends

class CINOSSioTftExpTab
 
class CTFTIELuint8
 

Additional Inherited Members

- Public Types inherited from CINOSTask
enum  ETskType {
  eTskTypeBoot = 0 , eTskTypeResource = 1 , eTskTypeSystem = 2 , eTskTypeApplication = 3 ,
  eTskTypeCommunication = 4 , eTskTypeRealtime = 5 , eTskTypeInterrupt = 6 , eTskTypeBackground = 7 ,
  eTskTypeLua = 8 , eTskTypeTest = 9 , eTskTypeReserved0 = 10 , eTskTypeReserved1 = 11 ,
  eTskTypeUser0 = 12 , eTskTypeUser1 = 13 , eTskTypeUser2 = 14 , eTskTypeUser3 = 15
}
 Task types.
 

Detailed Description

Main inco explorer class for TFT display.

This class shows all tabs and variables and reacts to key presses. A user can navigate through tabs and variables and edit the variables if allowed to.

Constructor & Destructor Documentation

◆ CINOSSioTftExp()

CINOSSioTftExp::CINOSSioTftExp ( const char acName,
CINOSSioTft apDisplay,
const char acConfig 
)

Constructor.

Parameters
acNameName of the explorer task.
apDisplayDisplay to work with.
acConfigName of the explorer config file

Member Function Documentation

◆ Action()

virtual void CINOSSioTftExp::Action ( )
protectedvirtual

Main task function.

Reimplemented from CINOSTask.

◆ AppendSpaces()

static void CINOSSioTftExp::AppendSpaces ( char apText,
uint32  auSize 
)
static

Appends spaces to a string to fill the remaining part of the buffer.

Parameters
apTextText to append spaces (inplace).
auSizeSize of buffer

◆ GetActualTab()

void CINOSSioTftExp::GetActualTab ( char apTab,
uint32  auLength,
bool  abFullPath = false 
)

Get currently selected tab.

Parameters
apTabBuffer to receive the name.
auLengthMaximum length to write into buffer.
abFullPathTrue if the full path is desired

◆ GetActualVar()

void CINOSSioTftExp::GetActualVar ( char apVar,
uint32  auLength 
)

Get default name of currently selected variable.

Parameters
apTabBuffer to receive the name.
auLengthMaximum length to write into buffer.

◆ GetActualVarLang()

void CINOSSioTftExp::GetActualVarLang ( char apVar,
uint32  auLength 
)

Get actual selected variable in selected language.

Parameters
apTabBuffer to receive the name.
auLengthMaximum length to write into buffer.

◆ GetActualVarValue()

void CINOSSioTftExp::GetActualVarValue ( char apVal,
uint32  auLength 
)

Get value of actual selected variable.

Parameters
apTabBuffer to receive the name.
auLengthMaximum length to write into buffer.

◆ GetColumns()

uint32 CINOSSioTftExp::GetColumns ( STFTFontInfo arInfo)
inlineprotected

Get number of columns for this font.

Parameters
arInfoObject that provides info about font.
Returns
Number of columns possible with this font.

◆ GetFlags()

uint32 CINOSSioTftExp::GetFlags ( )
inline

Get internal flags (e.g. shift mode).

Returns
Explorer flags.

◆ GetLangFileName()

const char * CINOSSioTftExp::GetLangFileName ( uint32  auLangIndex) const

Check if language file by index available.

Returns
Language file name.

◆ GetLanguage()

uint32 CINOSSioTftExp::GetLanguage ( )

Get selected language to display.

Returns
Number of currently selected language.

◆ GetNext()

CINOSSioTftExp * CINOSSioTftExp::GetNext ( )
inlineprotected

Get next explorer inlist.

Returns
Next linked explorer.

◆ GetPressedKeys()

uint32 CINOSSioTftExp::GetPressedKeys ( )
inline

Get pattern of pressed user keys (matrix).

Returns
Bit pattern of pressed keys.

◆ GetRows()

uint32 CINOSSioTftExp::GetRows ( STFTFontInfo arInfo)
inlineprotected

Get number of rows for this font.

Parameters
arInfoObject that provides info about font.
Returns
Number of rows possible with this font.

◆ GetTopTab()

CINOSSioTftExpTab * CINOSSioTftExp::GetTopTab ( ) const
inline

To get the top tab pointer.

Returns
Top tab pointer

◆ HardCopy()

void CINOSSioTftExp::HardCopy ( int16  aiXX1 = -1,
int16  aiYY1 = -1,
int16  aiXX2 = -1,
int16  aiYY2 = -1,
bool  abUseRLE = true 
)

Do a hard copy (screenshot) of current screen

Parameters
aiXX1X-coordinate of upper left corner (default: full screen)
aiYY1Y-coordinate of upper left corner (default: full screen)
aiXX2X-coordinate of lower right corner (default: full screen)
aiYY2Y-coordinate of lower right corner (default: full screen)
abUseRLEUse RLE compression (default: true = yes)

◆ MakeFloatValue()

static void CINOSSioTftExp::MakeFloatValue ( char apBuf,
void apValue,
char  acFormat,
uint16  auDigits 
)
static

Format float value (for no-float targets).

Parameters
apBufBuffer to receive formatted value.
apValueAddress of numeric value.
acFormatDesired format for formatting.
auDigitsNumber of digits in formatting.

◆ ProcessLangFile()

void CINOSSioTftExp::ProcessLangFile ( char apFile)
protected

Terminate all strings with 0 so they can be used directly.

Parameters
apFileText to process, should be 0 terminated.

◆ ReplaceNewLines()

static uint32 CINOSSioTftExp::ReplaceNewLines ( char apText,
uint32  auSize,
bool  abEscaping 
)
static

Replace '
' in a string with '|' for display, give count of newlines.

Parameters
apTextText to fix (inplace).
auSizeMaximum size of buffer if fixed text needs more space.
abEscapingFlag if more escaping of 'dangerous' chars is needed.
Returns
Number of newlines.

◆ SelLanguage()

void CINOSSioTftExp::SelLanguage ( uint32  auLangIndex)

Select language to display.

Parameters
auIndexLanguage index for names.

◆ SetActualTab()

void CINOSSioTftExp::SetActualTab ( char apTab)

Set current tab.

Parameters
apTabName of tab to select as 'PTab1.PTab2.MyTab'.

◆ SetTabCharacteristics()

void CINOSSioTftExp::SetTabCharacteristics ( const char *const  acTabPath,
uint32  auCharacteristics,
ETFTCharCmd  aeCmd 
)

Set (add/remove) characteristics of a tab.

Parameters
acTabPathPath of tab to change.
auCharacteristicsCharacteristics to apply.
aeCmdCommand to execute (set/add/clear).

◆ SetUserLevel()

void CINOSSioTftExp::SetUserLevel ( uint32  auLevel)

Set user level.

Parameters
auLevelLevel to allow variable edits.

◆ SetVarCharacteristics()

bool CINOSSioTftExp::SetVarCharacteristics ( const char *const  acVarPath,
uint32  auCharacteristics,
ETFTCharCmd  aeCmd 
)

Set (add/remove) characteristics of a variable.

Parameters
acVarPathPath of variable to change.
auCharacteristicsCharacteristics to apply.
aeCmdCommand to execute (set/add/clear).

◆ ShowProcs()

void CINOSSioTftExp::ShowProcs ( CINOSSioTftExpTab apTab)
protected

Show procedures of given tab.

Parameters
apTabTab to show procedures of.

◆ ShowProcsFix()

void CINOSSioTftExp::ShowProcsFix ( CINOSSioTftExpTab apTab)
protected

Show procedures of given tab.

Parameters
apTabTab to show procedures of.

◆ ShowTab()

uint32 CINOSSioTftExp::ShowTab ( CINOSSioTftExpTab apTab,
uint32  auLevel 
)
protected

Show tab with all elements.

Parameters
apTabTab to show.
auLevelNesting level to know Y coord of tabs on display.
Returns
Deepest level to know where variables can start.

◆ ShowTabFix()

uint32 CINOSSioTftExp::ShowTabFix ( CINOSSioTftExpTab apTab,
uint32  auLevel 
)
protected

Show tab with all elements.

Parameters
apTabTab to show.
auLevelNesting level to know Y coord of tabs on display.
Returns
Deepest level to know where variables can start.

◆ ShowVars()

void CINOSSioTftExp::ShowVars ( uint32  auCoordY,
CINOSSioTftExpTab apTab,
bool  abNames = false 
)
protected

Show vars, values with/without names.

Parameters
auCoordYY coordinate of first variable
apTabTab to show variables of.
abNamesFlag to also write names or only values.

◆ ShowVarsFix()

void CINOSSioTftExp::ShowVarsFix ( CINOSSioTftExpTab apTab,
bool  abNames = false 
)
protected

Show vars, values with/without names at fixed positions.

Parameters
apTabTab to show variables of.
abNamesFlag to also write names or only values.

◆ TextOut()

void CINOSSioTftExp::TextOut ( uint16  auCoordX,
uint16  auCoordY,
char pText,
STFTFontInfo arFontInfo,
int16  aiStrLength = -1,
uint32  auFlags = 0 
)
protected

Print a text with given font at given coordinates.

Parameters
auCoordXX coordinate of start position of text.
auCoordYY coordinate of start position of text.
pTextText to print.
arFontInfoInformation about used font.
aiStrLengthMaximum string length (if apText is longer).
auFlagsAdditional flags (stretched)

◆ UpdateInco()

bool CINOSSioTftExp::UpdateInco ( )

Update inco item pointers of items e.g. after new registrations.

Returns
True if at least one pointer changed.

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