-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathtemplates.rts2
71 lines (62 loc) · 2.4 KB
/
templates.rts2
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
<html>
<head>
<title>Template examples</title>
<rts2script script='setgetapi.js'/>
<rts2script script='targetedit.js'/>
</head>
<body onLoad='refreshData();'>
<script type='text/javascript' language="javascript">
function refreshData(){
getCallFunction("DOME","weather_open",function(v){
document.getElementById("DOME_weather_open").value = v;
if (v == 1) {
document.getElementById("DOME_on").checked = true;
} else {
document.getElementById("DOME_off").checked = true;
}
});
getCall("DOME","ignore_time",this.document.getElementById("DOME_ignore_time_raw"),true);
getCallTime("DOME","ignore_time",this.document.getElementById("DOME_ignore_time"),true);
getCall("DOME","moveCountTop",this.document.getElementById("DOME_moveCountTop"));
setTimeout('refreshData();',1000);
}
</script>
<h1>Some template examples</h1>
<table border="0" style="border-spacing: 40px 0px;">
<tr>
<td>weather_open</td>
<td>
<input name='v' value='off' id='DOME_weather_open'/>
<input type="radio" id="DOME_on" name="DOME_on_off" value="1" onClick='setGetCallFunction("DOME","weather_open",1,function(nv){document.getElementById("DOME_on").value=nv;alert("new value " + nv);});' />OPEN
<input type="radio" id="DOME_off" name="DOME_on_off" value="0" onClick='setGetCallFunction("DOME","weather_open",0,function(nv){document.getElementById("DOME_on").value=nv;alert("new value " + nv);});' />CLOSE
</td>
</tr>
<tr>
<td>ignore_time</td>
<td>
<input name='v' value='off' size='50' id='DOME_ignore_time_raw'/>
<input name='v' value='off' size='50' id='DOME_ignore_time'/>
<button onClick='setCall("DOME","ignore_time",document.getElementById("DOME_ignore_time").value);'>set</button>
</td>
</tr>
<tr>
<td>TEST_INT</td>
<td>
<input value='' id='SD_TEST_INT'/>
<button onClick='setGetCall("SD","TEST_INT",document.getElementById("SD_TEST_INT"));'>Set</button>
</td>
</tr>
<tr>
<td>Create target</td>
<td>
Name: <input value='' id='tn'/>
RA: <input value='' id='ra'/>
DEC: <input value='' id='dec'/>
Description: <input value='' id='desc'/>
<button onClick='createTarget(document.getElementById("tn").value,document.getElementById("ra").value,document.getElementById("dec").value,document.getElementById("desc").value,function(nid){ alert("created target with ID " + nid); });'>Create</button>
</td>
</tr>
</table>
<device>DOME</device>
</body>
</html>