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

Getting Started:  Keywords

To use this interface, you must first make it cognizant of
some keywords.

You can pick a Service with the Service menu, which
will make the application go out to the Sybase database for
keyword information;  however, if you don't have a Sybase
connection (you're on a Linux crate, for example, or you're
too far from home to want to download all that info) you
can use the Load menu to 'reload' keyword information from
ascii files.

The ascii files are named by the user, so they could be called
almost anything, but one standard file is KTUIkeywords.dat.  That's
the default 'save file'.  Try reloading that.  It will fill in
the instrument name.

If all you want is a quick reference to the mouse bindings,
see the KeyBindings Help item.

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

Getting Started:  Meters

Now you have made the tool aware of some keywords, you can 
create some meters.   To create a meter, you have to place
the keyword name in the Keyword blank at the lower right.
DBII is theoretically capable of handling two or more
services at once, and disambiguating keywords where necessary.
You can type the keyword in upper or lower case, and either
as service.keyword or just as the keyword name.

Then pick a Meter Type using the menu at the lower left.  Having
established a Keyword and a Meter Type, you can use the 
Make Meter button at the lower extreme right to create the
meter, or hit RETURN in the Keyword blank.
If you selected an illegal meter type for the keyword,
you will get a default type instead.

You can have several meters watching the same keyword.

Now that you have a meter on the screen, you can move it around;
just click on the border with Mouse-1 and drag it to where you
want it.  The name of the keyword should be shown on the meter.

Each type of meter has its own help information, which you can
get by Ctrl-Mouse-1 on the meter itself.

The following special clicks work on the wide border area,
just like dragging:

To edit the characteristics of a meter, use Shift-Mouse-1 to
bring up the Meter Editor panel.  You can customize your meters
quite radically if you wish.

To divorce a meter from the dashboard, use Shift-Mouse-2 --
the meter should jump into a toplevel window of its own,
which you can place anywhere you like.  It remains active.
The PutMeAway button will restore the meter to its rightful
location on the dashboard.

To remove a meter entirely, use Ctrl-Shift-Mouse-3 to delete it.
I know that's a rather inconvenient sequence, but I didn't
want to make it so easy as to happen by accident... :-)

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

Aesthetic Tweaks:  Graphics

If you use Mouse-3 on an empty area of the canvas (engr mode only)
you will see a list of Graphic Objects that you can plop down on
the dashboard.  These objects might be labels, pointers, or indicators
of some kind to help you monitor your KTL system.

All Graphics start out in the upper left corner, like Meters.  You
can reposition and edit them using the same magic mouse clicks
as you would use for Meters.  And they can be made to reconfigure
themselves in response to KTL events (see below).

Graphics will do one thing Meters won't.  They can clone themselves.
Use Ctrl-Shift-Mouse-1 to duplicate a graphic.

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

Advanced Features:  Pseudo Keywords and Conditions

There are two buttons we haven't told you about:  PseudoKW and
Alarms/Conditions.

-------

A pseudo-keyword is a computed value based on other keywords.  For
example, if you were interested in the sine of ELAPTIME (silly
example, but it will do) you could create a pseudo keyword called
SINEL, which is expressed as ' sin ( ELAPTIME ) '.  Please note the
spaces separating each token of the expression.  For this release,
you must provide those spaces.  A later release might be more 
intelligent, but for now, always separate each syntactic element
from the rest with white space.

You can use any mathematical expression that would be legitimate in
a Tcl expr command.  You create PseudoKW using the PseudoKW button,
which pops up a simple form.

PseudoKW can be associated with Meters, just like regular keywords.
You can plot or log complex functions expressed using the values
of various keywords.

-------

A Condition is a general-purpose concept.  It's like a PseudoKeyword,
except that it evaluates to a Boolean (T/F) value.  Any boolean expression
using keywords and pseudokeywords is legitimate, for example:

	ELAPTIME >= TTIME / 2 
or 
	EXPOSIP == 'true'.  

You can even refer to global variables in your expressions, as follows:

	ELAPTIME != \$Desired(hires,ELAPTIME)

Conditions can be applied to Meter Configurations (the things you
edit using Shift-Mouse-1) to make Meters reconfigure themselves
if certain expressions involving keywords are true.  They can be
used similarly to reconfigure Graphics conditionally.  And they
are the heart of the Alarms mechanism.

To edit Meter conditions and Graphic conditions you use the Meter
Attribute Editor and Graphic Attribute Editor (Shift-Mouse1).   If
you name a configuration something other than 'Normal' and attach
a Condition to it (in the neighbouring blank), then change some
attributes and hit COMMIT, you have created a conditional
configuration.  Your configuration will be rejected if your
boolean expression is illegal.

In Meter conditional expressions ONLY you can use 2 short cuts:
if you just enter a numeric value, the expression parser will assume
you mean 'ThisKeyword == value', where ThisKeyword is the one
this meter is monitoring.  If you enter only two numeric values, the
expression parser will assume that you mean 'ThisKeyword between
val1 and val2'.

A 'between' operator is included in the expression parser for your
convenience.  The syntax 'between 10 15' is legal, and will be
transformed by the parser into the unwieldy legitimate form.

To create or edit an Alarm you use the Alarms button, which brings
up a form.  You must first create an alarm name, then attach
conditions and consequences to the alarm.  (The Colour information
is just a hook for future development, but the severity levels
and command evaluation should work.)

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

With all these toys in your toolbox you can make interfaces where
meters move around or change their colours and other attributes
in response to arbitrary KTL conditions.  You can add graphics,
such as flow control arrows which turn red when active and black
when inactive, or rectangles which turn gray when a cover is in
place and clear when it is open.  You can write custom Tcl code
to be executed upon certain alarm conditions, or more easily
pop up warning message boxes (the default action on Warn and Error
severities).  The only limits are your patience and the ability of 
the Tk interp to handle the number of callbacks on each KTL event.

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

