This contains more details on the automatic image generation functions.
Also read the comments in ui/web/imagelib.inc

Config File Format
------------------

These config files are intended to be provided by (product).mod modules and are usually product specific. They must be installed in /usr/sausalito/swatch and named with a ".conf" extension.

The image config file frmat is used to provide a flexible way to describe images and (optional) subimages that are overlaid upon the original image. This is used by Active Monitor as a generic mechanism to do error images. The images usually show a picture of the machine, overlaid with subimages of components of the machine. An example might be to graphically show which hard drives are active and which have failed. Or to show the location of a failed power supply.

1. SYNTAX

The syntax of the image config files is XML. Each config file consists of 1 or more elements. An element is started with the form:
	"<" SP* element_name SP+ (attr_name SP* "=" SP* attr_val)* ">"
	If the element has a content field (for example: subimages are
content of a class) the element is ended with:
	"</" SP* element_name SP* ">"
	If there is no content field, the element may use the above form to
end an element, or may use the optional start form with no second end
tag:
	"<" SP* element_name SP+ (attr_name SP* "=" SP* attr_val)* "/>"

2. Elements
The elements definable in a schema are:
	IMAGE
	SUBIMAGE
	STATE

2.1 Syntax: IMAGE
	An IMAGE is a top level element. Only an IMAGE may be in a top level element.
	
	Tag name: "image"
	Required attributes: "name", "background"
	Optional attributes: any
	Valid children: 0 or more "subimage"
	Valid parents: none

	"background" is the location of the image file that will be used as the basis for this IMAGE.

2.2 Syntax: SUBIMAGE
	A SUBIMAGE is an image that may (optionally) be overlaid upon the base image.

	Tag name: "subimage"
	Required attributes: "name", "show"
	Optional attributes: "locationX", "locationY"
	Valid children: 0 or more "STATE"
	Valid parents: "image"

	"show" specifies under which conditions this subimage object should be shown. 
	When set to "never", this subimage will never be drawn.
	When set to "ifavailable", this subimage will be drawn if status information exists.
	This is useful when you want to turn off the subimage. For example,
	if the hardware ships with fan tachometer 2 disconnected, the status information will show
	that the fan has 0 RPM. In this case, we know that the fan is disabled and so would not 
	want to show it in the UI.

	"locationX" and "locationY". There are the (x,y) coordinate where we want to place the subimage.

2.3 Syntax: STATE
	A STATE is one of several states the component can be in.
	These states usually correspond to error conditions.
	Once a valid state is found, the image corresponding to the state will be used for the subimage.

	Tag name: "state"
	Required attributes: "img", one of "code" or ("threshold_min" or "threshold_max")
	Optional attributes: "locationX", "locationY", "msg"
	Valid children: none
	Valid parents: "subimage"

	"img" is the image file that the subimage will use to represent this state.
	"threshold_min", "threshold_max" are provided so the AM code can automatically detect which
	state you are in. If status information is numeric, the status information will be compared 
	against the listed thresholds. The state will be matched 
	if threshold_min <= state < threshold_max

	"code" is one of 'N', 'G', 'Y', 'R', that correspond to the Active Monitor statecodes. If
	status information is not numeric, it will be compared against the codes until it finds a match.
	The matching state will then provide the image to use.

	"locationX" and "locationY". There are the (x,y) coordinate where we want to place the subimage.
	If these are present, they override the location coordinates specified in parent "subimage".
	
	
