
Internal Data Structures and Methods

KTUI is a state engine at heart.  It's event-driven, and its
behaviour is determined by a 'database' of global arrays containing
all its knowledge about the world.

KTUI's world consists of KTL keywords, meters displaying/setting 
those keywords, graphical objects decorating the dashboard where
the meters are installed, and some global variables for interacting
with keywords.  Here's the low-down on the innards of KTUI.  What
you see here is a list of global variables, with some explanation
of what they do and how (if arrays) they are indexed.

This is by no means the complete inventory of global variables, state
mechanisms, etc.  It is, however, the core or skeleton on which the
whole application hangs.

-------------------------------------------------------------------------------

Keywords	array of keyed lists.  index is mid (Meme ID from Memes table)
		the keyed list keys are the attributes of a Meme.
		Keywords is short for KTL Keywords.
PKeywords	array of keyed lists.  index is incrementing Pkeyword counter.
		the keyed list keys are the attributes of a Pkeyword.
		PKeywords is short for PseudoKeywords.  the PseudoKeyword
		Editor lets you edit this.

Meters		array of keyed lists.  index is MeterId, an incrementing counter.
		the keyed list keys are attributes of a Meter.
Mconfigs	simple array.   index is MeterId.
		keeps track of how many alternate configs every Meter has.  
		default value is 1 (Normal)
Mcondits	array of keyed lists.  index is MeterId,ConditionId
		stores the conditional expressions for the different configs for
		any meter.  the keys are the attributes of a condition.
Mattribs	array of keyed lists.  index is MeterId,ConditionId.
		stores the sets of alternate attributes for a Meter according
		to its various conditions.  this is what the Item Editor lets
		you edit.
Mappear		array of keyed lists.  index is MeterId.
		keeps track of the current appearance of each Meter.

Desired		simple array.  index is Service,KWname.
		contains desired or 'next' values for any keyword.

<service>	simple array.  index is KWname.
		contains current value of all KTL keywords.  bound to KTL
		broadcast callback in live mode.  unbound in fake mode.
	

Graphics	Like Meters, above;  but keys are attribs of graphical objects.
Gconfigs	Like Mconfigs.
Gcondits	Like Mcondits.
Gattribs	Like Mattribs.
Gappear		Like Mappear.

Canvases	Like Meters, above;  but keyes are attribs of a Canvas (dashboard).
Cconfigs	Like Mconfigs.
Ccondits	Like Mcondits.
Cattribs	Like Mattribs.
Cappear		Like Mappear.

Alarms		array of keyed lists.  Index is AlarmId.
		keys are the attributes of an Alarm family.  An alarm family 
		consists of a related cluster of conditions and severity/message/
		action information.  the Alarm Editor lets you edit this.
Acondits	array of keyed lists.  Index is AlarmId,ConditionId.
		keys are the attributes of a condition/handling element.
		the Alarm Editor lets you edit this too.

Procs		simple array of lists.  keys are Service,KWname or VariableName.
		list elements are Tcl commands to be executed when a keyword or
		variable changes its value.  a proc varChange looks up the
		keyword or variable in the Procs array and executes all the
		commands it finds there.  varChange is invoked either by the
		'trace variable w' mechanism or by KTL broadcast callback.

MeterId		a global incrementing counter : next Meter Id.
GraphicId	ditto for Graphics.
WindowId	ditto for Dashboards.

----------------------------------------------------------------------------------

If you want to see the contents of all these variables without having to
use tkinspect or wade through them at the command line, you can just Save
Layout to a named file, then read the file (enjoy!).

