/Custom ODB tree: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 110: Line 110:
</div>  
</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.
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>
---------
---------
Line 129: Line 130:
* '''Type:''' STRING
* '''Type:''' STRING
* '''Default:'''
* '''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.
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.


Line 141: Line 142:
* '''Type:''' STRING
* '''Type:''' STRING
* '''Default:'''
* '''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.  
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,  
For example,  
Line 157: Line 158:
* '''Type:''' STRING
* '''Type:''' STRING
* '''Default:'''
* '''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".  
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the font size for this label. Supported values are "small",  "medium" or "giant".  


Line 170: Line 171:
* '''Type:''' INT
* '''Type:''' INT
* '''Default:'''
* '''Default:'''
 
</div>
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the X position for this label in pixels.
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the X position for this label in pixels.


Line 181: Line 182:
* '''Type:''' INT
* '''Type:''' INT
* '''Default:'''
* '''Default:'''
 
</div>
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the Y position for this label in pixels.
This key in the [[#<label-name>subtree|<label-name> subtree]] contains the Y position for this label in pixels.


Line 193: Line 194:
* '''Type:''' INT
* '''Type:''' INT
* '''Default:'''
* '''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).  
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).  


Line 206: Line 207:
* '''Type:''' STRING
* '''Type:''' STRING
* '''Default:'''
* '''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.  
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>
Line 221: Line 222:
* '''Type:''' STRING
* '''Type:''' STRING
* '''Default:'''
* '''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.  
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>
Line 232: Line 233:




=== <span style="color:purple; font-style:italic">Fills/span> subtree ===
== <span style="color:purple; font-style:italic">Fills</span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
* '''Type:''' DIR
Line 244: Line 245:
<br>
<br>


=== <span style="color:purple; font-style:italic">Bars/span> subtree ===
== <span style="color:purple; font-style:italic">Bars</span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
* '''Type:''' DIR
Line 258: Line 259:


= Colour Table =
= Colour Table =
 
For convenience, a colour reference table is shown here for some common colours:
{|  style="text-align: left; width: 100%; background-color: rgb(255, 255, 255);" border="3" cellpadding="2" cellspacing="2"
{| 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;" | 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; background-color: rgb(204, 204, 255); font-weight: bold;" | RGB Value


|-
|-
Line 271: Line 271:


|-
|-
| colspan="1" rowspan="1" style="vertical-align: top; background-color: grey; color: white; font-weight: normal;" | White
| 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; color: black; font-weight: normal;" | 000000
| 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


|}
|}

Revision as of 17:05, 2 July 2014

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

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 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 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

For convenience, a colour reference table is shown here for some common colours:

Colour RGB Value
Black 000000
White FFFFFF
Red FF0000
Lime green 00FF00
Blue 0000FF
Yellow FFFF00
Grey 808080