trace.html 2 KB
Newer Older
Jeroen Vreeken's avatar
Jeroen Vreeken committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<html>

<head>
 <title>
  Dwingeloo trace test
 </title>
</head>

<body bgcolor="white">

  <p>
  
   <h2>Tracing</h2>
   <table border=1>
    <tr>
     <th>Trace Name</th><th>Update frequency</th>
     <th>Timestamp</th><th>Value</th><th>Unit</th>
    </tr>
    <tr>
     <td><div id="trace_name"></div></td>
     <td><div id="trace_freq"></div></td>
     <td><div id="trace_time"></div></td>
     <td><div id="trace_val"></div></td>
     <td><div id="trace_unit"></div></td>
    </tr>
   </table>

  <p>
   
   <h2>The following traces are available:</h2>
   <form>
       <select id="tracelist_select"></select>
       <select id="tracelist_freq">
        <option>1</option>
	<option>2</option>
	<option>5</option>
	<option>10</option>
       </select>
       <input type="button" value="view" onClick="trace_selected()"></input>
   </form>

</body>

<script src="trace_list.js"></script>
<script src="trace.js"></script>

<script type="text/javascript">

var trace_url = "trace.cgi";

function testtrace_value(obj, time, value, unit)
{
	document.getElementById('trace_name').innerHTML = obj.tracename;
	document.getElementById('trace_freq').innerHTML = obj.freq;
	document.getElementById('trace_time').innerHTML = time;
	document.getElementById('trace_val').innerHTML = value;
	document.getElementById('trace_unit').innerHTML = unit;
}

testtrace = new trace();
testtrace.callback = testtrace_value;
testtrace.open(trace_url, 'Azimuth_Position', 2);

tracelist = new trace_list();
tracelist.open('trace_list.cgi');
tracelist_select = document.getElementById("tracelist_select");
tracelist_freq = document.getElementById("tracelist_freq");

for (i = 0; i < tracelist.list.length; i++) {
	tracelist_select.options[i] =
	    new Option(tracelist.list[i].tracename +" [" + tracelist.list[i].unit + "]");
}

function trace_selected()
{
	var newtrace = tracelist.list[tracelist_select.selectedIndex];
	var freq = tracelist_freq.options[tracelist_freq.selectedIndex].text;
	
	testtrace.open(trace_url, newtrace.tracename, freq);
}

</script>

</html>