1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
<xsl:output encoding="utf-8"/>
5
<xsl:variable name="service">
6
services/katrin.php?target=file&
9
<xsl:template name="image">
10
<xsl:param name="width" />
11
<xsl:param name="height" />
13
<xsl:variable name="link">
14
<xsl:text>setups/katrin/services/katrin.fcgi?target=file&</xsl:text>
16
<xsl:text>kdb_run=</xsl:text>
17
<xsl:value-of select="@run" />
18
<xsl:text>&</xsl:text>
20
<xsl:text>kdb_name=</xsl:text>
21
<xsl:value-of select="@name" />
24
<xsl:element name="a">
25
<xsl:attribute name="href">
26
<xsl:value-of select="$link" />
27
<xsl:text>.png</xsl:text>
29
<xsl:attribute name="target">_blank</xsl:attribute>
30
<xsl:element name="img">
31
<xsl:attribute name="src">
32
<xsl:value-of select="$link" />
33
<xsl:text>_pv.png</xsl:text>
35
<xsl:attribute name="border">0</xsl:attribute>
36
<xsl:attribute name="alt">
37
<xsl:value-of select="." />
39
<xsl:attribute name="width">
40
<xsl:value-of select="$width" />
42
<xsl:attribute name="height">
43
<xsl:value-of select="$height" />
50
<xsl:template match="image" mode="small">
51
<xsl:call-template name="image">
52
<xsl:with-param name="width" select="'150'" />
53
<xsl:with-param name="height" select="'100'" />
57
<xsl:template match="image" mode="normal">
58
<xsl:call-template name="image">
59
<xsl:with-param name="width" select="'300'" />
60
<xsl:with-param name="height" select="'200'" />
64
<xsl:template match="image" mode="large">
65
<xsl:call-template name="image">
66
<xsl:with-param name="width" select="'600'" />
67
<xsl:with-param name="height" select="'400'" />
71
<xsl:template match="image" mode="table">
73
<xsl:apply-templates select="." mode="small" />
77
<xsl:template match="image" mode="title">
78
<th><xsl:value-of select="." /></th>
81
<xsl:template match="file">
83
<xsl:element name="a">
84
<xsl:attribute name="href">
85
<xsl:text>setups/katrin/services/katrin.fcgi?target=file</xsl:text>
86
<xsl:text>&kdb_download=yes</xsl:text>
88
<xsl:text>&kdb_run=</xsl:text>
89
<xsl:value-of select="@run" />
92
<xsl:text>&kdb_name=</xsl:text>
93
<xsl:value-of select="@name" />
96
<xsl:value-of select="." />
98
<xsl:if test="@filesize">
99
<span style="font-size: small">
100
<xsl:text> (</xsl:text>
101
<xsl:value-of select="@filesize" />
102
<xsl:text>)</xsl:text>
108
<!-- ADEI links and images -->
109
<xsl:template name="adeiurl">
110
<xsl:text>db_server=</xsl:text>
111
<xsl:value-of select="@server" />
112
<xsl:text>&db_name=</xsl:text>
113
<xsl:value-of select="@database" />
114
<xsl:text>&db_group=</xsl:text>
115
<xsl:value-of select="@group" />
116
<xsl:if test="@mask">
117
<xsl:text>&db_mask=</xsl:text>
118
<xsl:value-of select="@mask" />
120
<xsl:if test="@window">
121
<xsl:text>&window=</xsl:text>
122
<xsl:value-of select="@window" />
126
<xsl:template match="adei">
127
<xsl:element name="a">
128
<xsl:attribute name="href">
129
<xsl:text>javascript:adei.config.Load('</xsl:text>
130
<xsl:call-template name="adeiurl" />
131
<xsl:text>&module=graph&setup=katrin, true)</xsl:text>
133
<xsl:value-of select="." />
137
<xsl:template match="plots">
138
<table style="margin:10px 0">
140
<xsl:apply-templates select="image" mode="title" />
143
<xsl:apply-templates select="image" mode="table" />
148
<xsl:template match="streams">
149
<xsl:for-each select="type">
150
<xsl:variable name="title">
152
<xsl:when test="@name=uw">UW</xsl:when>
153
<xsl:when test="@name='ipe3_energy'">IPE3 Energy</xsl:when>
154
<xsl:when test="@name='ipe3_waveform'">IPE3 Waveform</xsl:when>
155
<xsl:when test="@name='ipe3_histogram'">IPE3 Histogram</xsl:when>
156
<xsl:when test="@name='ipe4_energy'">IPE4 Energy</xsl:when>
157
<xsl:when test="@name='ipe4_waveform'">IPE4 Waveform</xsl:when>
158
<xsl:when test="@name='ipe4_histogram'">IPE4 Histogram</xsl:when>
161
<xsl:element name="img">
162
<xsl:attribute name="src">
163
<xsl:text>setups/katrin/images/</xsl:text>
164
<xsl:value-of select="@name" />
165
<xsl:text>.png</xsl:text>
167
<xsl:attribute name="height">16</xsl:attribute>
168
<xsl:attribute name="alt">
169
<xsl:value-of select="$title" />
171
<xsl:attribute name="title">
172
<xsl:value-of select="$title" />
174
<xsl:attribute name="style">
175
<xsl:text>margin: 0 5px; vertical-align: middle</xsl:text>
181
<xsl:template match="downloads">
183
<xsl:apply-templates select="file" />
186
<xsl:template match="transmission">
189
<xsl:text>Transmission (</xsl:text>
190
<xsl:value-of select="@parameter" />
191
<xsl:text>):</xsl:text>
193
<xsl:apply-templates select="image" mode="large" />
197
<xsl:template match="parameter">
200
<xsl:text>Control parameter (</xsl:text>
201
<xsl:value-of select="@parameter" />
202
<xsl:text>):</xsl:text>
204
<xsl:apply-templates select="image" mode="normal" />
208
<xsl:template match="countrate">
211
<xsl:apply-templates select="image" mode="normal" />
215
<xsl:template match="errors">
219
<xsl:for-each select="error">
220
<span class="service">
221
<xsl:value-of select="@service" />
223
<xsl:text>: </xsl:text>
224
<xsl:value-of select="." />
232
<xsl:template match="parameters">
233
<xsl:if test="fluke">
235
<td><b>Voltage:</b></td>
236
<td><xsl:value-of select="fluke" /> V</td>
241
<xsl:template match="run">
245
<h2>Run <xsl:value-of select="identifier" /></h2>
248
<a href="javascript:katrin.SetCustomProperties('kdb_run=')">
254
<td colspan="2" style="padding: 0 10px">
255
<xsl:apply-templates select="streams" />
258
<xsl:apply-templates select="errors" />
260
<td rowspan="1" style="width:600px; padding: 0 10px 0 0">
261
<xsl:apply-templates select="plots/transmission" />
262
<table style="font-size:small">
264
<td><b>Start:</b></td>
265
<td><xsl:value-of select="start" /></td>
268
<td><b>Duration:</b></td>
269
<td><xsl:value-of select="duration" /></td>
272
<td><b>Configuration:</b></td>
273
<td><xsl:value-of select="configuration" /></td>
276
<td><b>ORCA version:</b></td>
277
<td><xsl:value-of select="orca_version" /></td>
279
<xsl:apply-templates select="parameters" />
283
<xsl:apply-templates select="plots/countrate" />
284
<xsl:apply-templates select="plots/parameter" />
285
<xsl:apply-templates select="downloads" />
290
<xsl:apply-templates select="plots" />
292
<td style="vertical-align:bottom">
294
<xsl:if test="../subruns">
295
<a href="javascript:katrin.SetCustomProperties('kdb_subruns=0')">
299
<xsl:if test="not(../subruns)">
300
<a href="javascript:katrin.SetCustomProperties('kdb_subruns=1')">
310
<xsl:template match="subrun">
311
<div style="margin: 20px 0">
312
<h4>Subrun <xsl:value-of select="identifier" /></h4>
313
<table style="font-size:small">
315
<td><b>Start:</b></td>
316
<td><xsl:value-of select="start" /></td>
320
<td><xsl:value-of select="end" /></td>
322
<xsl:apply-templates select="parameters" />
324
<xsl:apply-templates select="plots" />
328
<xsl:template match="subruns">
330
<xsl:apply-templates select="subrun" />
334
<xsl:template match="/result">
335
<div style="margin: 10px">
337
<xsl:when test="Error">
339
<xsl:value-of select="Error" />
342
<xsl:apply-templates select="run" />
343
<xsl:apply-templates select="subruns" />