Mchart: 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/programs/#mchart mchart] on the Programs and options page for the new documentation about the mchart program.
= Links =
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* [[stripchart]]
* [[History System]]
</div>
 
= Purpose =
{{Utility|name=mchart}} is a MIDAS utility that assembles data from the ODB for a stripchart graphics program.
 
= Features =
{{Utility|name=mchart}} is a periodic data retriever of a specific path in the ODB, which can be used in conjunction with a stripchart graphic program. The mchart/stripchart feature has been largely superceded by the MIDAS [[History System]].
 
In a two-step procedure
# a specific path in the ODB can be scanned for composing a '''configuration file''' by extracting all numerical data references. The filename  (e.g. filename.conf) is specified with the -f filename argument.
# <span style="color:darkcyan;">''mchart''</span> will produce (at a fixed time interval) a refreshed '''data file''' containing the values of the numerical data specified in the configuration file.
 
This file is then available for a stripchart program to be used for a chart-recording type of graph. Two possible stripcharts are available:
 
<div id="gstripchart"></div>
; gstripchart
: The configuration file generated by  <span style="color:darkcyan;">''mchart''</span> is compatible with the GNOME stripchart which permits sophisticated data equation manipulation. On the other hand, the data display is not very fancy and provides just a basic chart recorder.
<div id="stripchart"></div>
; stripchart
: This tcl/tk graphical stripchart data display application written by Gertjan Hofman (see [[stripchart]]) provides a far better graphical chart recorder display tool, it also permits history save-set display, but the equation scheme is not implemented.
 
= Arguments =
        [-h ] : help
        [-h hostname ] : host name.
        [-e exptname ] : experiment name.
        [-D ] : start program as a daemon (prevented if -c or -q)
                requires [[MIDAS environment variables#MCHART_DIR|MCHART_DIR]]
        [-u time] : data update periodicity (def:5s).
        [-f file] :  configuration or data file name
        [-q <span style="color: purple; font-style:italic;"><ODBpath></span> ] : equipment ODB path
        [-b lower_value] : sets general lower limit for all variables (only with -q)
        [-t upper_value] : sets general upper limit for all variables (only with -q)
        [-c ] : create config only
        [-k ] : keep spawned stripchart or gstripchart
        [-g ] : spawn Hofman stripchart or gstripchart if possible
        [-gg ] : force the spawning of gstripchart for graphic.
        [-gh ] : force the spawning stripchart (tcl/tk) for graphic.
 
= Usage =
    Creation  : mchart -e myexpt -h myhost -c
                -f mydata -q /equipement/myeqp/variables
    Running  : mchart -e myexpt -h myhost -f mydata
    Run/Graph : mchart -e myexpt -h myhost -f mydata -g
    MCHART_DIR: environment variable for mchar directory
 
The configuration contains one entry for each variable found under the {{Odbpath|path=<ODBpath>}}requested. The format is described in the [[#gstripchart|gstripchart]] documentation.
 
Once the configuration file has been created, it is possible to apply any valid operation (equation) to the parameters of the file following the gstripchart syntax. In the case of the use of the [[#stripchart|stripchart]] from G.Hofman, only the "filename", "pattern", "maximum", "minimum" fields are used.
 
When using {{Utility|name=mchart}} with the -D Argument, it is necessary to have the MIDAS environment variable [[MIDAS environment variables#MCHART_DIR|MCHART_DIR]] defined in order to allow the daemon to find the location of the configuration and data files.
 
= Example Configuration File =
chaos:~/chart> more trigger.conf
  #Equipment:            >/equipment/kos_trigger/statistics
menu:                  on
slider:                on
type:                  gtk
minor_ticks:            12
major_ticks:            6
chart-interval:        1.000
chart-filter:          0.500
slider-interval:        0.200
slider-filter:          0.200
begin:        Events_sent
  filename:    /home/chaos/chart/trigger
  fields:      2
  pattern:      Events_sent
  equation:    \$2
  color:        \$blue
  maximum:      1083540.00
  minimum:      270885.00
  id_char:      1
end:            Events_sent
begin:        Events_per_sec.
  filename:    /home/chaos/chart/trigger
  fields:      2
  pattern:      Events_per_sec.
  equation:    $2
  color:        \$red
  maximum:      1305.56
  minimum:      326.39
  id_char:      1
end:            Events_per_sec.
begin:        kBytes_per_sec.
  filename:    /home/chaos/chart/trigger
  fields:      2
  pattern:      kBytes_per_sec.
  equation:    $2
  color:        \$brown
  maximum:      898.46
  minimum:      224.61
  id_char:      1
end:            kBytes_per_sec.
 
= Example Data File =
A second file (data file) will be updated a fixed interval by the {{Utility|name=mchart}} utility.
 
  chaos:~/chart> more trigger
    Events_sent 6.620470e+05
    Events_per_sec. 6.463608e+02
    kBytes_per_sec. 4.424778e+02
 
= Example =
 
* Creation with <span style="color: purple; font-style:italic;"><ODBpath></span> being one array of 2 elements in the <span style="color: purple; font-style:italic;">/Variables</span> subdirectory :
 
      chaos:~/chart> mchart -f chvv -q  <span style="color: purple; font-style:italic;">/equipment/chv/variables/chvv</span> -c
      chaos:~/chart> ls -l chvv*
      -rw-r--r--  1 chaos    users        474 Apr 18 14:37 chvv
      -rw-r--r--  1 chaos    users        4656 Apr 18 14:37 chvv.conf
 
* Creation of all the sub-keys in the  <span style="color: purple; font-style:italic;">/Variables</span> subdirectory :
 
      mchart -e myexpt -h myhost -f chv -q <span style="color: purple; font-style:italic;">/equipment/chv/variables</span> -c
 
* Creation and running in debug:
 
      chaos:~/chart> mchart -f chv -q <span style="color: purple; font-style:italic;">/equipment/chv/variables</span> -d
      CHVV : size:68
      <span style="color:brown">#name:17 #Values:17
      CHVI : size:68</span>
 
* Running a pre-existing conf file (chv.conf) debug:
 
      chaos:~/chart> mchart -f chv.conf -d
      CHVV : size:68
      <span style="color:brown">#name:17 #Values:17</span>
      CHVI : size:68
      <span style="color:brown">#name:17 #Values:17</span>
 
* Running a pre-existing configuration file and spawning [[#gstripchart|gstripchart]] :
 
      chaos:~/chart> mchart -f chv.conf -gg
      spawning graph with gstripchart -g 500x200-200-800 -f /home/chaos/chart/chv.conf ...
 
* Running a pre-existing configuration file and spawning [[#stripchart|stripchart]] (see [[stripchart#Installation]])
 
      chaos:~/chart> mchart -f chv.conf -gh
      spawning graph with stripchart /home/chaos/chart/chv.conf ...
 
[[Category:Utilities]]

Latest revision as of 22:01, 30 October 2026

The midas documentation has moved. See mchart on the Programs and options page for the new documentation about the mchart program.