/History 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
 
Line 1: Line 1:
{{Pagelinks}}
The midas documentation has moved. See [https://midas.triumf.ca/docs/develop/reference/reference/odb_keys/#history /History] on the ODB keys page and [https://midas.triumf.ca/docs/develop/features/storing_data/history/configuring/ History: configuring] for the new documentation about the /History ODB keys.
 
= Links =
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* [[History System]]
* [[mhttpd]] [[History Page]]
* [[Keys in the ODB /Logger tree|/Logger ODB tree]]
* [[Keys in the ODB /Logger/History subtree|/Logger/History subtree]]
*
</div>
 
= Purpose  =
The ODB /History tree contains information related to the [[History System]].
 
= Creating the /History tree =
The <span style="color:purple; font-style:italic">/History</span>  ODB tree is created by [[mlogger]]. A single group named "Default"is created containing the trigger rate for the "Trigger" equipment. The user customizes the /History tree by adding new panels as needed from the mhttpd [[History Page]]. Much of the <span style="color:purple; font-style:italic">/History</span> tree is created and used by the [[History System]] and need not concern the user.
 
 
= Example of /History tree =
 
The system created the following /History tree using the  [[/Equipment ODB tree#Example of /Equipment tree|/Equipment/INFO tree]]. The history tags are derived from the variable "Names" (if present) in the [[/Equipment ODB tree#Example Settings subtree|Settings subtree]].  [[History System#History drivers|MIDAS-history]] is selected. 
 
New panels in the <span style="color:purple; font-style:italic">/History/Display</span> subtree are added from the [[History Page]] (see [[#Display subtree|example below]]).
 
[local:pol:S]/History>ls -lr
Key name                        Type    #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
History                        DIR
    LoggerHistoryChannel        STRING  1    32    24h  0  RWD
    DisableTags                BOOL    1    4    1h  0  RWD  n
    Display                    DIR
        Default                DIR
            Trigger rate        DIR
                Variables      STRING  2    64    1h  0  RWD
                                        [0]            System:Trigger per sec.
                                        [1]            System:Trigger kB per sec.
                Time Scale      STRING  1    32    1h  0  RWD  1h
                Factor          FLOAT  2    4    1h  0  RWD
                                        [0]            1
                                        [1]            1
                Offset          FLOAT  2    4    1h  0  RWD
                                        [0]            0
                                        [1]            0
                Timescale      STRING  1    32    1h  0  RWD  1h
                Zero ylow      BOOL    1    4    1h  0  RWD  y
                Show run markersBOOL    1    4    1h  0  RWD  y
                Log axis        BOOL    1    4    24h  0  RWD  n
                Show values    BOOL    1    4    24h  0  RWD  n
                Sort vars      BOOL    1    4    24h  0  RWD  n
                Show old vars  BOOL    1    4    24h  0  RWD  n
                Minimum        FLOAT  1    4    24h  0  RWD  -inf
                Maximum        FLOAT  1    4    24h  0  RWD  inf
    Links                      DIR
        System                  DIR
            Trigger per sec. -> /Equipment/Trigger/Statistics/Events per sec.
                                DOUBLE  1    8    16h  1  RWD  0
            Trigger kB per sec. -> /Equipment/Trigger/Statistics/kBytes per sec.
                                DOUBLE  1    8    16h  1  RWD  0
    Events                      DIR
        101                    STRING  1    7    1h  0  RWD  System
        0                      STRING  1    16    24h  0  RWD  Run transitions
        3                      STRING  1    5    24h  0  RWD  INFO
    Tags                        DIR
        101                    STRING  3    96    1h  0  RWD
                                        [0]            System
                                        [1]            10[1] Trigger per sec.
                                        [2]            10[1] Trigger kB per sec.
        0                      STRING  3    96    1h  0  RWD
                                        [0]            Run transitions
                                        [1]            6[1] State
                                        [2]            6[1] Run number
        3                      STRING  25    96    24h  0  RWD
                                        [0]            INFO
                                        [1]            9[1] Data still buffered
                                        [2]            9[1] Num SIS LNE events
                                        [3]            9[1] LNE count from SIS
                                        [4]            9[1] LNE preset value
                                        [5]            9[1] number of bins
                                        [6]            9[1] data bytes code
                                        [7]            9[1] num enabled channels
                                        [8]            9[1] discard first bin
                                        [9]            9[1] discard first cycle
                                        [10]            9[1] not used
                                        [11]            9[1] Scan type code
                                        [12]            9[1] Number good cycles
                                        [13]            9[1] Number supercycles
                                        [14]            9[1] Cycle num within supercycle
                                        [15]            9[1] Sweep number
                                        [16]            9[1] Num cycles skipped
                                        [17]            9[1] Num cycles histogrammed
                                        [18]            9[1] DAC Increment number
                                        [19]            9[1] DAC Set Value (volts)
                                        [20]            9[1] DAC Readback (volts)
                                        [21]            10[1] SC Sum ch17
                                        [22]            10[1] SC Sum ch18
                                        [23]            10[1] SC Sum ch19
                                        [24]            10[1] SC Sum ch20
    Display Settings            DIR
        Width Group            STRING  1    256  24h  0  RWD  Small
 
 
 
 
=Keys in the <span style="color:purple; font-style:italic">/History</span> ODB tree =
 
== <span style="color:purple; font-style:italic">LoggerHistoryChannel</span>  ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' STRING
* '''Default:'''  "MIDAS"
</div>
 
This key in the [[#top|/History ODB tree]] selects the  [[Keys in the ODB /Logger/History subtree#<history-logging-channel> subtree|history-logging-channel]]  to be used for saving the History data.
The history-logging-channel determines the  [[History System#History drivers|history driver]] to be used for saving the history data (see also
[[Keys in the ODB /Logger/History subtree##Type|Type]] key).
 
If  <span style="color:purple; font-style:italic">LoggerHistoryChannel</span> is blank, the first
[[Keys in the ODB /Logger/History subtree#Active|Active]] channel will be used.
 
 
== <span style="color:purple; font-style:italic">DisableTags</span> ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' BOOL
* '''Default:'''  "n"
</div>
 
This key in the [[#top|/History ODB tree]]  only used for [[History System#History drivers|MIDAS-history]], and is not used by the other [[History System#History drivers|history drivers]].
 
Set this key in the [[#top|/History ODB tree]] to "y" if reading the history tags directly from the history files. Set to "n" to read the history tags from the ODB.
If this key is set to "y" the [[#Tags|Tags subtree]]  (if present) will be deleted.
 
See [[History System#History Tag names|History Tag names]].
 
 
<br>
---------
<br>
 
 
== <span style="color:purple; font-style:italic">CreateOldTags</span> ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' BOOL
* '''Default:'''  "n"
</div>
 
This key in the [[#top|/History ODB tree]]  only used for [[History System#History drivers|MIDAS-history]], and is not used by the other [[History System#History drivers|history drivers]].
 
If this key is set to "y", it will force creation of the  [[#Tags subtree|Tags subtree]]  using the old format. See [[History System#MIDAS-History Tag names|Tag names]].
 
This key is optional and may not be present in recent versions.
<br>
---------
<br>
 
 
 
 
 
 
== <span style="color:purple; font-style:italic">MaxDisplayEvents</span> ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' INT
* '''Default:'''  20
</div>
 
This key in the [[#top|/History ODB tree]] is used by [[mhttpd]] to set the maximum number of events displayed on the [[mhttpd]] history page   <span style="color:red; font-style:italic">  (is this correct??)</span>
 
 
<br>
---------
<br>
 
 
== <span style="color:purple; font-style:italic">MaxDisplayTags</span> ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' INT
* '''Default:'''  20
</div>
 
This key in the [[#top|/History ODB tree]] is used by [[mhttpd]] to set the maximum number of tags <span style="color:red; font-style:italic"> (is this correct??)</span>
 
 
<br>
---------
<br>
 
 
 
== <span style="color:purple; font-style:italic">PerVariableHistory (obsolete)</span> ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' INT
* '''Default:'''  "n"
</div>
 
 
This key in the [[#top|/History ODB tree]] is OBSOLETE and should be deleted from the ODB if using a recent version of MIDAS. A message will be printed to this effect.
 
It has been replaced by [[Keys in the ODB /Logger/History subtree#/Logger/History/MIDAS/PerVariableHistory|PerVariableHistory]].
 
 
<br>
---------
<br>
 
== <span style="color:purple; font-style:italic">Links</span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
</div>
 
This subtree in the  [[#top|/History ODB tree]] is created by [[mlogger]]. It is used for [[History System#Types of History Events|Virtual History Events]].
The user may create links under this subtree to any ODB variable to record the history of that variable as a virtual history event.
 
<br>
---------
<br>
 
=== <span style="color:purple; font-style:italic">System</span> subtree ===
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
</div>
 
This subtree in the  [[#Links subtree|Links subtree]] is created by [[mlogger]] if an equipment named "Trigger" is present.
 
 
<br>
---------
<br>
 
 
==== <span style="color:purple; font-style:italic">Trigger per sec.</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' LINK
</div>
 
This link in the  [[#System subtree|System subtree]] is created by [[mlogger]] if an equipment named "Trigger" is present.
<span style="color:purple; font-style:italic">Trigger per sec.</span> is linked to the key <span style="color:purple; font-style:italic">/Equipment/Trigger/Statistics/Events per sec.</span>.
 
<br>
---------
<br>
 
==== <span style="color:purple; font-style:italic">Trigger kB per sec.</span> ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' LINK
</div>
 
This link in the  [[#System subtree|System subtree]] is created by [[mlogger]] if an equipment named "Trigger" is present.
<span style="color:purple; font-style:italic">Trigger kB per sec.</span> is linked to the key <span style="color:purple; font-style:italic">/Equipment/Trigger/Statistics/kBytes per sec.</span>.
 
 
<br>
---------
<br>
 
== <span style="color:purple; font-style:italic">Tags</span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
</div>
 
This subtree in the  [[#top|/History ODB tree]] is used by the system for private data storage for the [[Keys in the ODB /Logger/History subtree#<history-logging-channel> subtrees|MIDAS-history]] driver, and is not used for ODBC-history or SQLITE-history (see [[History System#History drivers|history drivers]]).
 
<span style="color:red; font-style:italic">How about MYSQL or FILE history drivers ??<br><br>Are the following statements all true?? </span>
 
* This subtree will be deleted for MIDAS-history with old-style tags.
* This subtree will be deleted if [[#DisableTags|DisableTags]] is set. 
* If [[#CreateOldTags|CreateOldTags]] is set, this subtree will be created with the old format.
 
 
If MIDAS-history is enabled, and the Equipment key [[/Equipment ODB tree#Log history]] is set for one or more Equipments, this subtree is created by [[mlogger]].
It contains history tags created by [[mlogger]] for each equipment set to [[/Equipment ODB tree#Log history]].  
 
<span style="color:red; font-style:italic">
Is the key /Equipment/Settings/PerVariableHistory key an optional key created by the user? </span>
 
If the global [[Keys in the ODB /Logger/History subtree#PerVariableHistory|PerVariableHistory]] key is set or the 
[[/Equipment ODB tree#PerVariableHistory|PerVariableHistory]] key in the /Equipment/Settings subtree of that equipment, then tags for that Equipment
will be created automatically by [[mlogger]]. The names of the tags will be taken from /Equipment/Settings/Names if present, otherwise default tag names will be created.
 
 
The contents of the event will then be completely copied into the MIDAS-history files, using the definition of the event as tag names for every element of the event.
 
 
 
 
== <span style="color:purple; font-style:italic">Display</span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
</div>
 
This subtree in the  [[#top|/History ODB tree]] is created by the Midas web server [[mhttpd]] when the History button on the main status page is pressed.
It contains parameters used by the system to control the History panels display on the [[mhttpd]] history page. It contains a subtree for each defined [[History panel]].
 
 
<br>
---------
<br>
 
 
=== <span style="color:purple; font-style:italic"><panel-name></span> subtree ===
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
</div>
 
This subtree in the  [[#<panel-name> subtree|Display subtree]] is named for the panel on the [[mhttpd]] History page, and contains information to define the contents
of this panel. In the example, only one panel is defined, named Default. If there is more than one panel defined, there will be other panel subtrees present with different  panel names.
 
The <panel-name> subtrees are created when the <span style="color: #444444; background-color: #CCCCCC; font-style:italic; font-size: 90; padding:0.25em; padding-left: 0.5em;padding-right: 0.5em;border:1px solid #808080;border-radius: 5px;margin-bottom:1px;">New</span> button is pressed on the [[History Page]]. Panels can also be grouped under a panel group name. In the following example, a number of panel group names are defined:
[local:deap:Running]/>ls /history/display/
Default
Temperatures
SCBs
UPSs
CDU
VME
Rates
etc.
Each panel group contains a number of panels, e.g.
[local:deap:Running]/>ls /history/display/UPSs
UPS
UPS1
UPS2
UPS3
Each of these is a <panel-name> subtree containing the information required for the [[History Page]] to display the panel.
The history page for this system is shown in Figure 1 on the [[History Page]].
 
<br>
---------
<br>
 
 
 
== <span style="color:purple; font-style:italic">Display Settings</span> subtree ==
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* '''Type:''' DIR
</div>
 
This subtree in the [[#top|/History ODB tree]] is created by the Midas web server [[mhttpd]] when the History button on the main status page is pressed.
It contains parameters used by the system to control the History Display on the [[mhttpd]] History page.
<br>
---------
<br>
 
 
== <span style="color:purple; font-style:italic">Events</span> subtree ==
This subtree in the  [[#top|/History tree]] is used by the system for
private data storage for the MIDAS-history driver, and is not used by any other [[History System#History drivers|history driver]].
 
<br>
---------
<br>
 
 
== <span style="color:purple; font-style:italic">Images</span> subtree ==
This subtree in the  [[#top|/History tree]] is used to specify which webcams should be logged as part of the [[Image History]] system.
 
<b>You should create a subdirectory for each webcam you want to record</b>, and each subdirectory should have the keys listed below. Note that [[Mlogger|mlogger]] creates <code>/History/Images/Demo/</code> as an example, and you may find it easiest to edit/copy that subdirectory rather than creating a new one from scratch.
 
* <code>Name</code> (string): Name of this camera
* <code>Enabled</code> (boolean): Whether to enable readout of camera
* <code>URL</code> (string): URL to fetch an image from the camera
* <code>Period</code> (int): Time period in seconds to fetch a new image
* <code>Storage hours</code> (int): Number of hours to store the images (0 for infinite)
* <code>Extension</code> (string): Image file extension, usually ".jpg" or ".png"
* <code>Timescale</code> (string): Initial horizontal time scale to show on the webpage (e.g. <code>8h</code> for 8 hours, <code>30m</code> for 30 minutes)
 
The following keys are also present in each subdirectory, and are used internally by the logger:
 
* <code>Last fetch</code> (int)
* <code>Error interval (s)</code> (int)
* <code>Last error</code> (int)
 
<br>
---------
<br>
 
 
 
 
[[Category:ODB Tree]] [[Category:History]]

Latest revision as of 22:00, 30 October 2026

The midas documentation has moved. See /History on the ODB keys page and History: configuring for the new documentation about the /History ODB keys.