/Custom ODB tree: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
(The midas documentation has moved to https://midas.triumf.ca/docs/)
Tag: Replaced
 
(46 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Links ==
The midas documentation has moved. See [https://midas.triumf.ca/docs/develop/reference/reference/odb_keys/#custom /Custom] on the ODB keys page and [https://midas.triumf.ca/docs/develop/features/monitoring_and_control/custom_pages/ Custom pages: overview] for the new documentation about the /Custom ODB keys.
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* [[mhttpd |MIDAS web server (mhttpd)]]
*
</div>
 
= Purpose =
The <span style="color:purple; font-style:italic;">/Custom</span> 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 <span style="color:purple; font-style:italic;">/images</span> subtree is required if an imagefile (*.gif) is to be displayed on the custom page.
 
= Creating the /Custom tree =
The <span style="color:purple; font-style:italic">/Custom</span> ODB tree is an optional tree that may be [[ODB#Creating ODB keys|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 <span style="color:purple; font-style:italic;">/Custom</span> 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 in the /Custom tree|Key names]]).
 
The user chooses the names of any keys in the <span style="color:purple; font-style:italic;">/Custom</span> ODB tree except for
* the Key name "Status" is reserved (see [[#Replace Status page]]).
* <span style="color:purple; font-style:italic;">/images</span> subtree
 
There are two characters that have special meaning if they are the last character of a Key name in the <span style="color:purple; font-style:italic;">/Custom</span> 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.
 
 
= <span style="color:purple; font-style:italic">Images</span> subtree =
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
</div>
 
This optional subtree in the  [[#top|/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.
 
<br>
---------
<br>
 
== <span style="color:purple; font-style:italic"><Image-name></span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
* '''Default:'''
</div>
User-created subdirectory named for the corresponding gif-image, e.g. "pol_sc.gif" in the [[#Example|example]] above. For multiple images, multiple subdirectories may be defined.
 
<br>
---------
<br>
 
== <span style="color:purple; font-style:italic">Background</span>  ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING
* '''Default:'''
</div>
 
This key in the  [[#<Image-name> subtree|<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.
 
<br>
---------
<br>
 
 
== <span style="color:purple; font-style:italic">Labels</span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
* '''Default:'''
</div>
User-created subdirectory  in the  [[#<Image-name> subtree|<image-name> subtree]] required if labels are to be superimposed on an image on a custom page.
 
<br>
---------
<br>
=== <span style="color:purple; font-style:italic"><label-name></span> subtree ===
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
* '''Default:'''
</div>
User-created subdirectory  in the  [[#Labels subtree|Labels subtree]] containing keys to define this label as listed below. There will be a <span style="color:purple; font-style:italic"><label-name></span> 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|example]] above.
<br>
---------
<br>
 
==== <span style="color:purple; font-style:italic">Src</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING
* '''Default:'''
</div>
This key in the [[#<label-name>subtree|<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.
 
<br>
---------
<br>
 
 
==== <span style="color:purple; font-style:italic">Format</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING
* '''Default:'''
</div>
This key in the [[#<label-name>subtree|<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|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.
 
 
<br>
---------
<br>
 
 
==== <span style="color:purple; font-style:italic">Font</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING
* '''Default:'''
</div>
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the font size for this label. Supported values are "small",  "medium" or "giant".
 
 
<br>
---------
<br>
 
 
==== <span style="color:purple; font-style:italic">X</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' INT
* '''Default:'''
</div>
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the X position for this label in pixels.
 
<br>
---------
<br>
 
==== <span style="color:purple; font-style:italic">Y</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' INT
* '''Default:'''
</div>
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the Y position for this label in pixels.
 
<br>
---------
<br>
 
 
==== <span style="color:purple; font-style:italic">Align</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' INT
* '''Default:'''
</div>
This key in the [[#<label-name>subtree|<label-name> subtree]] contains an integer representing Horizontal Alignment for this label. Set to one of 0 (left), 1 (center) or 2 (right).
 
<br>
---------
<br>
 
 
 
==== <span style="color:purple; font-style:italic">FGColor</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING
* '''Default:'''
</div>
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the foreground colour  for this label in the format RRGGBB (hex). See [[#Colour table|colour table]].  
 
<br>
---------
<br>
 
 
 
 
 
==== <span style="color:purple; font-style:italic">BGColor</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING
* '''Default:'''
</div>
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the background colour  for this label in the format RRGGBB (hex). See [[#Colour table|colour table]].
 
<br>
---------
<br>
 
 
 
 
 
== <span style="color:purple; font-style:italic">Fills</span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
* '''Default:'''
</div>
User-created subdirectory  in the  [[#<Image-name> subtree|<image-name> subtree]] required if fills are to be superimposed on an image on a custom page.
 
 
<br>
---------
<br>
 
== <span style="color:purple; font-style:italic">Bars</span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
* '''Default:'''
</div>
User-created subdirectory  in the  [[#<Image-name> subtree|<image-name> subtree]] required if bars are to be superimposed on an image on a custom page.
 
 
<br>
---------
<br>
 
 
= Colour Table =
For convenience, a colour reference table is shown here for some common colours:
{| class="wikitable"  style="margin: auto; ext-align: left; width: 25%; background-color: rgb(255, 255, 255);" border="3" cellpadding="2" cellspacing="2"
 
|-
| colspan="1" rowspan="1" style="vertical-align: top; background-color: rgb(204, 204, 255); font-weight: bold;" | Colour
| colspan="1" rowspan="1" style="vertical-align: top; background-color: rgb(204, 204, 255); font-weight: bold;" | RGB Value
 
|-
| colspan="1" rowspan="1" style="vertical-align: top; color: black; font-weight: normal;" | Black
| colspan="1" rowspan="1" style="vertical-align: top; color: black; font-weight: normal;" | 000000
 
|-
| colspan="1" rowspan="1" style="vertical-align: top; background-color: silver; color: white; font-weight: normal;" | White
| colspan="1" rowspan="1" style="vertical-align: top; background-color: silver; color: white; font-weight: normal;" | FFFFFF
 
|-
| colspan="1" rowspan="1" style="vertical-align: top; background-color: white; color: red; font-weight: normal;" | Red
| colspan="1" rowspan="1" style="vertical-align: top; color: black; font-weight: normal;" | FF0000
 
|-
| colspan="1" rowspan="1" style="vertical-align: top; background-color: silver; color: lime; font-weight: normal;" | Lime green
| colspan="1" rowspan="1" style="vertical-align: top;  background-color: silver; color: lime; font-weight: normal;" | 00FF00
 
|-
| colspan="1" rowspan="1" style="vertical-align: top; background-color: white; color: blue; font-weight: normal;" | Blue
| colspan="1" rowspan="1" style="vertical-align: top; color: black; font-weight: normal;" | 0000FF
 
|-
| colspan="1" rowspan="1" style="vertical-align: top; background-color: silver; color: yellow; font-weight: normal;" | Yellow
| colspan="1" rowspan="1" style="vertical-align: top; background-color: silver; color: yellow; font-weight: normal;" | FFFF00
 
|-
| colspan="1" rowspan="1" style="vertical-align: top; background-color: white; color: grey; font-weight: normal;" | Grey
| colspan="1" rowspan="1" style="vertical-align: top; color: black; font-weight: normal;" | 808080
 
|}
[[Category:ODB Tree]]
 
 
 
 
 
 
 
 
[[Category:ODB Tree]]

Latest revision as of 22:00, 30 October 2026

The midas documentation has moved. See /Custom on the ODB keys page and Custom pages: overview for the new documentation about the /Custom ODB keys.