-
Notifications
You must be signed in to change notification settings - Fork 0
/
usaxstv.xsl
236 lines (207 loc) · 7.59 KB
/
usaxstv.xsl
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Pragma" content="no-cache"/>
<!-- 2013-03-24,PRJ: override below, this is useless
<xsl:choose>
<xsl:when test="contains(//pv[@id='state']/value,'Radiography Mode')">
<meta http-equiv="Refresh" content="60" />
</xsl:when>
<xsl:otherwise>
<meta http-equiv="Refresh" content="10" />
</xsl:otherwise>
</xsl:choose>
-->
<meta http-equiv="Refresh" content="60"/>
<title>USAXS: TV status</title>
<style type="text/css">
body {
font: x-small Verdana, Arial, Helvetica, sans-serif;
}
h1 {
font-size: 145%;
margin-bottom: .5em;
}
h2 {
font-size: 125%;
margin-top: 1.5em;
margin-bottom: .5em;
}
h3 {
font-size: 115%;
margin-top: 1.2em;
margin-bottom: .5em
}
h4 {
font-size: 100%;
margin-top: 1.2em;
margin-bottom: .5em;
}
p {
font: x-small Verdana, Arial, Helvetica, sans-serif;
color: #000000;
}
.description {
font-weight: bold;
font-size: 150%;
}
td {
font-size: x-small;
}
li {
margin-top: .75em;
margin-bottom: .75em;
}
ul {
list-style: disc;
}
ul ul, ol ol , ol ul, ul ol {
margin-top: 1em;
margin-bottom: 1em;
}
li p {
margin-top: .5em;
margin-bottom: .5em;
}
.dt {
margin-bottom: -1em;
}
.indent {
margin-left: 1.5em;
}
sup {
text-decoration: none;
font-size: smaller;
}
</style>
</head>
<body>
<table border="0" width="100%" bgcolor="mintcream" rules="all"><tr>
<td width="56%">
<xsl:choose>
<xsl:when test="contains(//pv[@id='state']/value,'Radiography Mode')">
<!--
<script language="javascript">
if (navigator.userAgent.match(/like Mac OS X/i)) {
document.write('<img src="http://axis-server.xray.aps.anl.gov/axis-cgi/jpg/image.cgi?resolution=vga&amp;camera=4" width="100%" />');
}
else {
document.write('<img src="http://axis-server.xray.aps.anl.gov/axis-cgi/mjpg/video.cgi?resolution=VGA&amp;camera=4" width="100%" />');
}
</script>
-->
<script language="javascript">
if (navigator.userAgent.match(/like Mac OS X/i)) {
document.write('<img src="http://axis-server.xray.aps.anl.gov/axis-cgi/jpg/image.cgi?camera=4" width="100%" />');
} else {
document.write('<img src="http://axis-server.xray.aps.anl.gov/axis-cgi/mjpg/video.cgi?camera=4" width="100%" />');
}
</script>
</xsl:when>
<xsl:otherwise>
<img src="https://usaxslive.xray.aps.anl.gov/livedata.png" width="100%" />
</xsl:otherwise>
</xsl:choose>
</td>
<td width="44%">
<table width="100%" bgcolor="mintcream" rules="all"><tr>
<td bgcolor="darkblue" align="center">
<font color="white" size="6">
<a href="http://usaxs.xray.aps.anl.gov/livedata/" style="color: grey;"> _ </a>
USAXS status
<a href="http://usaxs.xray.aps.anl.gov/livedata/raw-report.html" style="color: grey;"> _ </a>
</font></td></tr>
<tr><td bgcolor="darkblue" align="center">
<font color="white" size="4">updated <xsl:value-of select="/usaxs_pvs/datetime"/></font></td></tr>
<xsl:call-template name="vertical_spacer"/>
<tr>
<xsl:choose>
<xsl:when test="//pv[@id='beam_available']/value=1">
<td bgcolor="#22ff22" align="center"><font size="3">
9-ID-C beam is available </font></td>
</xsl:when>
<xsl:otherwise>
<td bgcolor="#ff2222" align="center"><font size="3">
9-ID-C beam is not available</font></td>
</xsl:otherwise>
</xsl:choose>
</tr>
<tr>
<xsl:choose>
<xsl:when test="//pv[@id='SR_current']/value>2">
<td bgcolor="#22ff22" align="center"><font size="3">
APS current =
<xsl:value-of select="//pv[@id='SR_current']/value"/> mA</font></td>
</xsl:when>
<xsl:otherwise>
<td bgcolor="#ff2222" align="center"><font size="3">
APS current =
<xsl:value-of select="//pv[@id='SR_current']/value"/> mA</font></td>
</xsl:otherwise>
</xsl:choose>
</tr>
<tr>
<td align="center">
<font size="3">
DCM E = <xsl:value-of select="//pv[@id='DCM_E']/value"/> keV
</font>
</td>
</tr>
<tr><td align="center"><font size="3">I0: <xsl:value-of select="//pv[@id='I0_VDC']/value"/> V</font></td></tr>
<tr>
<xsl:call-template name="vertical_spacer"/>
<xsl:choose>
<xsl:when test="//pv[@id='USAXS_collecting']/value=1">
<td bgcolor="#22ff22" align="center"><font size="3">USAXS scan running</font></td>
</xsl:when>
<xsl:otherwise>
<td align="center"><font size="3">not scanning USAXS</font></td>
</xsl:otherwise>
</xsl:choose>
<tr>
<td align="center" bgcolor="bisque">
<table>
<tr>
<td align="left" bgcolor="bisque"><font size="3">
|Q| = <xsl:value-of select="//pv[@id='USAXS_Q']/value"/> (1/A),
</font></td>
<td align="center" bgcolor="bisque"> <br /> </td>
<td align="right" bgcolor="bisque"><font size="3">
I = <xsl:value-of select="//pv[@id='USAXS_I']/value"/> (a.u.)
</font></td>
</tr>
</table>
</td>
</tr>
<xsl:call-template name="vertical_spacer"/>
<tr><td align="center" bgcolor="bisque"><font size="5">
<xsl:value-of select="//pv[@id='sampleTitle']/value"/>
</font></td></tr>
<tr><td align="center" bgcolor="lightblue"><font size="5">
<xsl:value-of select="//pv[@id='state']/value"/>
</font></td></tr>
<xsl:call-template name="vertical_spacer"/>
<tr><td align="center"><font size="3">
<xsl:value-of select="//pv[@id='spec_dir']/value"
/>/<xsl:value-of select="//pv[@id='spec_data_file']/value"
/>
</font></td></tr>
<tr><td align="center"><font size="3">
scan #<xsl:value-of select="//pv[@id='spec_scan']/value"/>
</font> </td></tr>
<tr><td align="center"><font size="3">
<xsl:value-of select="//pv[@id='spec_scan']/timestamp"/>
</font></td></tr></tr>
</table>
</td></tr>
</table>
</body>
</html>
</xsl:template>
<!-- this template clarifies how to add a vertical space consistently in XSLT -->
<xsl:template name="vertical_spacer">
<tr><td height="75px"><br /></td></tr>
</xsl:template>
</xsl:stylesheet>