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>services/katrin.php?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>services/katrin.php?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="run">
236
<h2>Run <xsl:value-of select="identifier" /></h2>
239
<a href="javascript:katrin.SetCustomProperties('kdb_run=')">
245
<td colspan="2" style="padding: 0 10px">
246
<xsl:apply-templates select="streams" />
249
<xsl:apply-templates select="errors" />
251
<td rowspan="2" style="width:600px; padding: 0 10px 0 0">
252
<xsl:apply-templates select="plots/transmission" />
253
<table style="font-size:small">
255
<td><b>Start:</b></td>
256
<td><xsl:value-of select="start" /></td>
259
<td><b>Duration:</b></td>
260
<td><xsl:value-of select="duration" /></td>
263
<td><b>Configuration:</b></td>
264
<td><xsl:value-of select="configuration" /></td>
267
<td><b>ORCA version:</b></td>
268
<td><xsl:value-of select="orca_version" /></td>
273
<xsl:apply-templates select="plots/countrate" />
274
<xsl:apply-templates select="plots/parameter" />
275
<xsl:apply-templates select="downloads" />
279
<td style="vertical-align:bottom">
281
<xsl:if test="../subruns">
282
<a href="javascript:katrin.SetCustomProperties('kdb_subruns=0')">
286
<xsl:if test="not(../subruns)">
287
<a href="javascript:katrin.SetCustomProperties('kdb_subruns=1')">
297
<xsl:template match="subrun">
298
<div style="margin: 20px 0">
299
<h4>Subrun <xsl:value-of select="identifier" /></h4>
300
<table style="font-size:small">
302
<td><b>Start:</b></td>
303
<td><xsl:value-of select="start" /></td>
307
<td><xsl:value-of select="end" /></td>
310
<xsl:apply-templates select="plots" />
314
<xsl:template match="subruns">
316
<xsl:apply-templates select="subrun" />
320
<xsl:template match="/result">
321
<div style="margin: 10px">
323
<xsl:when test="Error">
325
<xsl:value-of select="Error" />
328
<xsl:apply-templates select="run" />
329
<xsl:apply-templates select="subruns" />