/Custom ODB tree
Links
Purpose
The /Custom ODB tree is required if the user wishes to create mhttpd custom pages. It contains essential data needed for mhttpd to display a custom page. The /images subtree is required if an imagefile (*.gif) is to be displayed on the custom page.
Creating the /Custom tree
The /Custom ODB tree is an optional tree that may be created by the user.
Example
The following example using the [[odbedit] ls command shows the optional custom tree for an experiment. Note the use of the "&" character to force the custom pages to be opened in the same frame, and the "!" key to suppress the custom-button from appearing on the mhttpd status page [local:pol:S]/ls -lr /Custom [local:pol:S]/custom>ls -rl
Key name Type #Val Size Last Opn Mode Value --------------------------------------------------------------------------- custom DIR ppg_cycle! STRING 1 80 36h 0 RWD /home/pol/online/pol/custom/pol.html ppg_cycle& STRING 1 80 36h 0 RWD /home/pol/online/pol/custom/pol_sc.html pol_functions! STRING 1 80 36h 0 RWD /home/pol/online/pol/custom/pol_functions.js style! STRING 1 80 36h 0 RWD /home/pol/online/pol/custom/style.css images DIR pol_sc.gif DIR background STRING 1 80 36h 0 RWD /home/pol/online/pol/custom/pol_sc.gif labels DIR num bins DIR Src STRING 1 256 36h 0 RWD /Equipment/pol_acq/settings/output/num bins per cycle Format STRING 1 32 36h 0 RWD %d Font STRING 1 32 36h 0 RWD Medium X INT 1 4 36h 0 RWD 315 Y INT 1 4 36h 0 RWD 502 Align INT 1 4 36h 0 RWD 0 FGColor STRING 1 8 36h 0 RWD FFFFFF BGColor STRING 1 8 36h 0 RWD 0000FF dwell time DIR Src STRING 1 256 36h 0 RWD /Equipment/POL_ACQ/Settings/input/dwell time (ms) Format STRING 1 32 36h 0 RWD %f ms Font STRING 1 32 36h 0 RWD large X INT 1 4 36h 0 RWD 145 Y INT 1 4 36h 0 RWD 430 Align INT 1 4 36h 0 RWD 0 FGColor STRING 1 8 36h 0 RWD FFFFFF BGColor STRING 1 8 36h 0 RWD 0000FF
Keys in the /Custom tree
The optional ODB /Custom tree may contain
- links to local external custom web pages created by the user (see below for remote external pages)
- links to internal webpages
- images subtree used to specify images for custom pages
If keys are defined in this tree, except where noted below, the names of the keys will appear as custom-buttons on the mhttpd Status page. By clicking on one of these custom-buttons, the custom page will be visible in a new frame (see also Key names).
The user chooses the names of any keys in the /Custom ODB tree except for
- the Key name "Status" is reserved (see #Replace Status page).
- /images subtree
There are two characters that have special meaning if they are the last character of a Key name in the /Custom tree :
- The character "&" forces the page to be opened within the current frame when the custom-button is pressed. If this character is omitted, the page will be opened in a new frame.
- The character "!" suppresses the custom-button from appearing on the main status page (hidden-link).
Neither of these characters will appear in the name of the button.
The hidden-link feature can be used to provide external webpages hidden from the user, such as a stylesheet or a file of Javascript functions needed by other custom pages.
Images subtree
- Type: DIR
This optional subtree in the /Custom ODB tree is created by the user. It is required if an imagefile (*.gif) is to be displayed on a custom page. This subtree is also required for any labels, bars or fills to be superimposed on the image.
<Image-name> subtree
- Type: DIR
- Default:
User-created subdirectory named for the corresponding gif-image, e.g. "pol_sc.gif" in the example above. For multiple images, multiple subdirectories may be defined.
Background
- Type: STRING
- Default:
This key in the <image-name> subtree contains the path and filename of the image file to be loaded into a custom page. Only gif format is supported for the image. This optional key is created by the user.
Labels subtree
- Type: DIR
- Default:
User-created subdirectory in the <image-name> subtree required if labels are to be superimposed on an image on a custom page.
<label-name> subtree
- Type: DIR
- Default:
User-created subdirectory in the Labels subtree containing keys to define this label as listed below. There will be a <label-name> subtree for each label superimposed on the custom image.
The user creates keys in this subtree with the names and types as listed below. See also the example above.
Src
- Type: STRING
- Default:
This key in the <label-name> subtree contains the path of a valid ODB Key variable. This is the value to be used for this label on an image.
Format
- Type: STRING
- Default:
This key in the <label-name> subtree contains the format for this label on the image. Format specifications (c.f. "printf" in C) are used to convert the value specified by the Src key into the output string that appears on the image. For example,
- "Count Rate:%5d kB/s" used to display an integer value
- "%5.2f%% iBu" used to display a floating point value. Note "%%" displays the "%" sign.
Font
- Type: STRING
- Default:
This key in the <label-name> subtree contains the font size for this label. Supported values are "small", "medium" or "giant".
X
- Type: INT
- Default:
This key in the <label-name> subtree contains the X position for this label in pixels.
Y
- Type: INT
- Default:
This key in the <label-name> subtree contains the Y position for this label in pixels.
Align
- Type: INT
- Default:
This key in the <label-name> subtree contains an integer representing Horizontal Alignment for this label. Set to one of 0 (left), 1 (center) or 2 (right).
FGColor
- Type: STRING
- Default:
This key in the <label-name> subtree contains the foreground colour for this label in the format RRGGBB (hex). See colour table.
BGColor
- Type: STRING
- Default:
This key in the <label-name> subtree contains the background colour for this label in the format RRGGBB (hex). See colour table.
Fills/span> subtree
- Type: DIR
- Default:
User-created subdirectory in the <image-name> subtree required if fills are to be superimposed on an image on a custom page.
Bars/span> subtree
- Type: DIR
- Default:
User-created subdirectory in the <image-name> subtree required if bars are to be superimposed on an image on a custom page.
Colour Table
Colour | RGB Value
|
Black | 000000 |
White | 000000 |