Old Custom Page Features

From MidasWiki
Revision as of 12:01, 21 December 2017 by Lindner (talk | contribs)
Jump to navigation Jump to search

The following is a record of a bunch of older, deprecated (as of Dec 2017) ways of building Custom Pages. Some of the features may still work in the newest MIDAS, but none are recommended.

Demo Custom Page

Figure 4: Demo Custom Page

A Demo Custom page is shown in Figure 4. The files needed to run this demo can be found in the MIDAS package in the directory ..packages/midas/examples/custom.

The HTML code for the Demo Custom page myexpt.html illustrates many of the available features. This example was written before the MIDAS Javascript Library, and is in HTML only (no JavaScript), with access to the ODB via the older HTML-style <odb> tags.

The file xcustom.odb contains the ODB keys needed by this demo, including the contents of the /Custom ODB tree. This demo illustrates the use of an image file myexpt.gif with superimposed fills, labels and bars. These features are not found in the code myexpt.html, but are added in the /Custom ODB tree as described in later sections. Loading the saved odb file xcustom.odb using the odbedit command ld will create all the odb keys needed for the Demo.

This (external) custom page is activated by adding the ODB key /Custom/MyExpt& which is a custom-link to the HTML code for the custom page myexpt.html see Keys in the /Custom tree and xcustom.odb).


Including the MIDAS Javascript Library is strongly recommended for anyone writing new custom pages that require access to the ODB, as it includes many useful features not otherwise available.

  <title>MyExperiment Demo Status</title>
  <meta http-equiv="Refresh" content="30">
 <form name="form1" method="Get" action="/CS/MyExpt&">
   <table border=3 cellpadding=2>
	<tr><th bgcolor="#A0A0FF">Demo Experiment<th bgcolor="#A0A0FF">Custom Monitor/Control</tr> 
	<tr><td> <b><font color="#ff0000">Actions: </font></b><input
		  value="Status" name="cmd" type="submit"> <input type="submit"
		  name="cmd" value="Start"><input type="submit" name="cmd" value="Stop">
	<center> <a href="http://midas.triumf.ca/doc/html/index.html"> Help </a></center>
	<td>Current run #: <b><odb src="/Runinfo/run number"></b></td>
	<td>#events: <b><odb src="/Equipment/Trigger/Statistics/Events sent"></b></td>
	<td>Event Rate [/sec]: <b><odb src="/Equipment/Trigger/Statistics/Events per sec."></b></td>
	<td>Data Rate [kB/s]: <b><odb src="/Equipment/Trigger/Statistics/kBytes per sec."></b></td>
	<td>Cell Pressure: <b><odb src="/Equipment/NewEpics/Variables/CellPressure"></b></td>
	<td>FaradayCup   : <b><odb src="/Equipment/NewEpics/Variables/ChargeFaradayCup"></b></td>
	<td>Q1 Setpoint: <b><odb src="/Equipment/NewEpics/Variables/EpicsVars[17]" edit=1></b></td>
	<td>Q2 Setpoint: <b><odb src="/Equipment/NewEpics/Variables/EpicsVars[19]" edit=1></b></td>
	<th> <img src="http://localhost:8080/HS/Default/Trigger%20rate.gif?
	<th> <img src="http://localhost:8080/HS/Default/Scaler%20rate.gif?
	<tr><td colspan=2>
	<map name="myexpt.map">
	<area shape=rect coords="140,70, 420,170" 
	        href="http://midas.triumf.ca/doc/html/index.html" title="Midas Doc">
	<area shape=rect coords="200,200,400,400"
	        href="http://localhost:8080" title="Switch pump">
     <area shape=rect coords="230,515,325,600"
            href="http://localhost:8080" title="Logger in color level (using Fill)">
	<img src="myexpt.gif" border=1 usemap="#myexpt.map">

Internal pages

There is some option for creating custom pages directly from ODB. This is documented in Internal Custom Page.