mhttpd is the Midas Web Server. It provides Midas DAQ control through the web using any web browser.
This daemon application has to run in order to allow the user to access from a Web browser any Midas experiment running on a given host. Full monitoring and "Almost" full control of a particular experiment can be achieved through this Midas Web server. The color coding is green for present/enabled, red for missing/disabled, yellow for inactive. It is important to note the refresh of the page is not "event driven" but is controlled by a timer (see Config- button). This mean the information at any given time may reflect the experiment state of up to n second in the paste, where n is the timer setting of the refresh parameter. Its basic functionality are:
The ...
mhttpd requires as argument the TCP/IP port number in order to listen to the web based request.
>mhttpd -p 8081 -D
-[Experiment/Date] Current Experiment, current date.
-[Action/Pages buttons] Run control button, Page switch button. At any web page level within the Midas Web page the main status page can be invoked with the <status> button.
odbedit
mkdir Script
cd Script
mkdir doit
cd doit
create string cmd
ln "/runinfo/run number" run
create string dest
set dest /dev/hda
[Version >= 1.8.3 Alias Hyperlink] This line will be present on the status page only if the ODB tree /Alias. The distinction for spawning a secondary frame with the link request is done by default. For forcing the link in the current frame, add the terminal charater "&" at the end of the link name.
odbedit ls create key Alias cd Alias ln /Equipment/Trigger/Common "Trig Setting" ln /Analyzer/Output "Analyzer" create key "Alias new window" <-- Version < 1.8.3 cd "Alias new window" ln /equipment/Scalers/Variables "Scalers Var" or cd Alias ln /Equipment/Trigger/Common "Trig Setting&" <-- Version >= 1.8.3
The title of each field is taken from the ODB key name it self. In the case this label has a poor meaning and extra explanation is required, you can do so by creating a new ODB tree under experiment Parameter Comments/ . Then by creating a string entry named as the one in Edit on Start- you can place the extra information relative to that key (html tags accepted).
This "parameter comment" option is available and visible ONLY under the midas web page, the odbedit start command will not display this extra information.
[local:midas:S]/Experiment>ls -lr
Key name Type #Val Size Last Opn Mode Value
---------------------------------------------------------------------------
Experiment DIR
Name STRING 1 32 17s 0 RWD midas
Edit on Start DIR
Write data BOOL 1 4 16m 0 RWD y
enable BOOL 1 4 16m 0 RWD n
nchannels INT 1 4 16m 0 RWD 0
dwelling time (ns) INT 1 4 16m 0 RWD 0
Parameter Comments DIR
Write Data STRING 1 64 44m 0 RWD Enable logging
enable STRING 1 64 7m 0 RWD Scaler for expt B1 only
nchannels STRING 1 64 14m 0 RWD <i>maximum 1024</i>
dwelling time (ns) STRING 1 64 8m 0 RWD <b>Check hardware now</b>
[local:midas:S]Edit on Start>ls -l
Key name Type #Val Size Last Opn Mode Value
---------------------------------------------------------------------------
Write Data LINK 1 19 50m 0 RWD /logger/Write data
enable LINK 1 12 22m 0 RWD /sis/enable
number of channels LINK 1 15 22m 0 RWD /sis/nchannels
dwelling time (ns) LINK 1 24 12m 0 RWD /sis/dwelling time (ns)
If the ODB is Write protected, a first window will request the web password.
From version 1.9.0, this page contains extra parameters for time selection and Email forwarding. Please refer to the ODB structure for further information.
The format of the message log can be written in HTML format.
The runlog button display the content of the file runlog.txt which is expected to be in the data directory specified by the ODB key /Logger/Data Dir . Regardless of its content, it will be displayed in the web page. Its common uses is to append lines after every run. The task appending this run information can be any of the midas application. Example is available in the Example /experiment/analyzer.c which at each end-of-run (EOR) will write to the runlog.txt some statistical informations.
When composing a new entry into the Elog, several fields are available to specify the nature of the message i.e: Author, Type, System, Subject. Under Type and System a pulldown menu provides multiple category. These categories are user definable through the odb under the tree /Elog/Types, /Elog/Systems. The number of category is fixed to 20 maximum but any remaining field can be left empty.
The task name hyperlink pops a new window pointing to the ODB section related to that program. The ODB structure for each program permit to apply alarm on the task presence condition and automatic spawning at either the begining or the end of a run.
From version 1.9.0, the history page display has been greatly improved:
This page reflects the html content of a given ODB key under the /Custom/ key. If keys are defined in the ODB under the /Custom/ the name of the key will appear in the main status page as the Alias keys. By clicking on the Custom page name, the content of the /Custom/<page> is interpreted as html content.
The access to the ODB field is then possible using specific HTML tags:
The insertion of a new Custom page requires the following steps:
Tue> odbedit
[local:midas:Stopped]/>ls
System
Programs
Experiment
Logger
Runinfo
Alarms
Equipment
[local:midas:Stopped]/>mkdir Custom
[local:midas:Stopped]/>cd Custom/
[local:midas:Stopped]/Custom>import mcustom.html
Key name: Test&
[local:midas:Stopped]/Custom>
Tue> odbedit [local:midas:Stopped]/>cd Custom/ [local:midas:Stopped]/Custom>export test& File name: mcustom.html [local:midas:Stopped]/Custom>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="Mozilla/4.76 [en] (Windows NT 5.0; U) [Netscape]"> <meta name="Author" content="Pierre-André Amaudruz"> <title>Set value</title> </head> <body text="#000000" bgcolor="#FFFFCC" link="#FF0000" vlink="#800080" alink="#0000FF"> <form method="GET" action="http://host.domain:port/CS/WebLtno&"> <input type=hidden name=exp value="ltno"> <center><table CELLSPACING=0 CELLPADDING=0 COLS=3 WIDTH="100%" BGCOLOR="#99FF99" > <caption><b><font face="Georgia"><font color="#000099"><font size=+2>LTNO Custom Web Page</font></font></font></b></caption> <tr BGCOLOR="#FFCC99"> <td><b><font color="#FF0000">Actions: </font></b> <input type=submit name=cmd value=Status> <input type=submit name=cmd value=Start> <input type=submit name=cmd value=Stop> <td> <input type=submit name=cmd value=ODB> <input type=submit name=cmd value=History> <input type=submit name=cmd value=Elog></td> </td> <td> <div align=right><b>LTNO experiment </b></div> </td> </tr> <tr> <td><b>Cryostat section:</b> <br>LN2 Bath Level : <odb src="/equipment/cryostat/variables/measured[12]"> <br>Run# : <odb src="/runinfo/run number" edit=1> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"></td> <td WIDTH="100%" BGCOLOR="#009900"><b>RF source section:</b> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"></td> <td WIDTH="50%" BGCOLOR="#FF6600"><b>Run section:</b> <br>Start Time: <odb src="/runinfo/start time"> <br>Stop Time: <odb src="/runinfo/stop time"> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"></td> </tr> <tr> <td BGCOLOR="#CC6600"><b>Sucon magnet section:</b> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"></td> <td BGCOLOR="#FFCC33"><b>Scalers section:</b> <br>Beam Current: <odb src="/equipment/epics/variables/measured[10]"> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"></td> <td BGCOLOR="#66FFFF"><b>Polarity section:</b> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"> <br>Run#: <odb src="/runinfo/run number"></td> </tr> </table></center> <img src="http://host.domain:port/HS/Meterdis.gif?exp=ltno&scale=12h&width=400"> <img src="http://host.domain:port/HS/Bridge.gif?exp=ltno&scale=12h&width=400"> <b><i><font color="#000099"><a href="http://host.domain/index.html"> <br> LTNO help</a></font></i></b> </body> </html>
Utilities - Top - Data format