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="adeiimage" mode="image">
138
<xsl:variable name="url">
139
<xsl:apply-templates select="adei" />
142
<xsl:element name="a">
143
<xsl:attribute name="href">
144
<xsl:text>javascript:adei.config.Load('</xsl:text>
145
<xsl:value-of select="$url" />
146
<xsl:text>&module=graph&setup=katrin', true)</xsl:text>
148
<xsl:element name="img">
149
<xsl:attribute name="src">
150
<xsl:text>services/getimage.php?</xsl:text>
151
<xsl:value-of select="$url" />
152
<xsl:text>&hide_axes=1&precision=LOW&width=</xsl:text>
153
<xsl:value-of select="@width" />
154
<xsl:text>&height=</xsl:text>
155
<xsl:value-of select="@height" />
157
<xsl:attribute name="alt">
158
<xsl:value-of select="@text" />
160
<xsl:attribute name="width">
161
<xsl:value-of select="@width" />
163
<xsl:attribute name="height">
164
<xsl:value-of select="@height" />
166
<xsl:attribute name="border">
167
<xsl:text>0</xsl:text>
174
<xsl:template match="adeiimage" mode="title">
175
<th><xsl:value-of select="@text" /></th>
178
<xsl:template match="plots">
179
<table style="margin:10px 0">
181
<xsl:apply-templates select="image" mode="title" />
184
<xsl:apply-templates select="image" mode="table" />
189
<xsl:template match="streams">
190
<xsl:for-each select="type">
191
<xsl:variable name="title">
193
<xsl:when test="@name=uw">UW</xsl:when>
194
<xsl:when test="@name='ipe3_energy'">IPE3 Energy</xsl:when>
195
<xsl:when test="@name='ipe3_waveform'">IPE3 Waveform</xsl:when>
196
<xsl:when test="@name='ipe3_histogram'">IPE3 Histogram</xsl:when>
197
<xsl:when test="@name='ipe4_energy'">IPE4 Energy</xsl:when>
198
<xsl:when test="@name='ipe4_waveform'">IPE4 Waveform</xsl:when>
199
<xsl:when test="@name='ipe4_histogram'">IPE4 Histogram</xsl:when>
202
<xsl:element name="img">
203
<xsl:attribute name="src">
204
<xsl:text>setups/katrin/images/</xsl:text>
205
<xsl:value-of select="@name" />
206
<xsl:text>.png</xsl:text>
208
<xsl:attribute name="height">16</xsl:attribute>
209
<xsl:attribute name="alt">
210
<xsl:value-of select="$title" />
212
<xsl:attribute name="title">
213
<xsl:value-of select="$title" />
215
<xsl:attribute name="style">
216
<xsl:text>margin: 0 5px; vertical-align: middle</xsl:text>
222
<xsl:template match="downloads">
224
<xsl:apply-templates select="file" />
227
<xsl:template match="parameters">
228
<xsl:if test="magnet_west or magnet_east">
229
<div style="background-color:#ccffcc">
230
<xsl:if test="magnet_west">
232
<b><xsl:value-of select="magnet_west" />A (<xsl:value-of select="field_west" />T)</b>
234
<xsl:if test="magnet_east">
236
<b><xsl:value-of select="magnet_east" />A (<xsl:value-of select="field_east" />T)</b>
240
<xsl:if test="det_ps or ps_egun">
242
<xsl:if test="det_ps">
245
<xsl:value-of select="det_ps" />
246
<xsl:text> </xsl:text>
249
<xsl:if test="ps_egun">
252
<xsl:value-of select="ps_egun" />
253
<xsl:text> </xsl:text>
258
<xsl:if test="t or s1 or s2 or s3 or s4 or d1 or d2">
259
<div style="background-color:#ffcc99">
263
<xsl:value-of select="t" />
264
<xsl:text> </xsl:text>
270
<xsl:value-of select="s1" />
271
<xsl:text> </xsl:text>
277
<xsl:value-of select="s2" />
278
<xsl:text> </xsl:text>
284
<xsl:value-of select="s3" />
285
<xsl:text> </xsl:text>
291
<xsl:value-of select="s4" />
292
<xsl:text> </xsl:text>
298
<xsl:value-of select="d1" />
299
<xsl:text> </xsl:text>
305
<xsl:value-of select="d2" />
306
<xsl:text> </xsl:text>
311
<xsl:if test="fug1 or fug2 or fug3 or fug4 or fug5">
312
<div style="background-color:#ffcc99">
315
<b><xsl:value-of select="fug1" />kV </b>
319
<b><xsl:value-of select="fug2" />kV </b>
323
<b><xsl:value-of select="fug3" />kV </b>
327
<b><xsl:value-of select="fug4" />kV </b>
331
<b><xsl:value-of select="fug5" />kV </b>
335
<xsl:if test="pressure">
336
<div style="background-color:#ffcc99">
338
<b><xsl:value-of select="pressure" />mbar </b>
341
<xsl:if test="egun_uv or egun_shutter or egun_hv or egun_x or egun_y">
342
<div style="background-color:#99ccff">
343
<xsl:if test="egun_uv">
346
<xsl:value-of select="egun_uv" />
347
<xsl:text> </xsl:text>
350
<xsl:if test="egun_shutter">
353
<xsl:value-of select="egun_shutter" />
354
<xsl:text> </xsl:text>
357
<xsl:if test="egun_hv">
359
<b><xsl:value-of select="egun_hv" />kV </b>
361
<xsl:if test="egun_x">
363
<b><xsl:value-of select="egun_x" />° </b>
365
<xsl:if test="egun_y">
367
<b><xsl:value-of select="egun_y" />° </b>
373
<xsl:template match="transmission">
376
<xsl:text>Transmission (</xsl:text>
377
<xsl:value-of select="@parameter" />
378
<xsl:text>):</xsl:text>
380
<xsl:apply-templates select="image" mode="large" />
384
<xsl:template match="parameter">
387
<xsl:text>Control parameter (</xsl:text>
388
<xsl:value-of select="@parameter" />
389
<xsl:text>):</xsl:text>
391
<xsl:apply-templates select="image" mode="normal" />
395
<xsl:template match="countrate">
398
<xsl:apply-templates select="image" mode="normal" />
402
<xsl:template match="errors">
406
<xsl:for-each select="error">
407
<span class="service">
408
<xsl:value-of select="@service" />
410
<xsl:text>: </xsl:text>
411
<xsl:value-of select="." />
419
<xsl:template match="run">
423
<h2>Run <xsl:value-of select="identifier" /></h2>
426
<a href="javascript:katrin.SetCustomProperties('kdb_run=')">
432
<td colspan="2" style="padding: 0 10px">
433
<xsl:apply-templates select="streams" />
436
<xsl:apply-templates select="errors" />
438
<td rowspan="2" style="width:600px; padding: 0 10px 0 0">
439
<xsl:apply-templates select="plots/transmission" />
440
<div class="properties">
441
<div style="background-color:silver">
444
<xsl:value-of select="date" />
445
<xsl:text> </xsl:text>
448
<b><xsl:value-of select="start" /> - <xsl:value-of select="end" /></b>
450
<div style="background-color:#ffff99">
453
<xsl:value-of select="detector" />
454
<xsl:text> </xsl:text>
457
<b><xsl:value-of select="detector_x" />cm </b>
459
<b><xsl:value-of select="detector_y" />cm </b>
461
<b><xsl:value-of select="detector_z" />cm </b>
463
<div style="background-color:#ffff99">
466
<xsl:value-of select="configuration" />
467
<xsl:text> </xsl:text>
470
<b><xsl:value-of select="orca_version" /> </b>
472
<xsl:apply-templates select="parameters" />
473
<div style="background-color:black; color:white">
476
<div style="background-color:black; color:white">
477
<b><xsl:value-of select="comment" /></b>
482
<xsl:apply-templates select="plots/countrate" />
483
<xsl:apply-templates select="plots/parameter" />
484
<xsl:apply-templates select="downloads" />
488
<td style="vertical-align:bottom">
490
<xsl:if test="../subruns">
491
<a href="javascript:katrin.SetCustomProperties('kdb_subruns=0')">
495
<xsl:if test="not(../subruns)">
496
<a href="javascript:katrin.SetCustomProperties('kdb_subruns=1')">
506
<xsl:template match="subrun">
507
<div style="margin: 20px 0">
508
<h4>Subrun <xsl:value-of select="identifier" /></h4>
509
<div class="properties" style="width:600px">
510
<div style="background-color:silver">
512
<b><xsl:value-of select="start" /> - <xsl:value-of select="end" /></b>
514
<xsl:apply-templates select="parameters" />
515
<div style="background-color:black; color:white">
518
<div style="background-color:black; color:white">
519
<b><xsl:value-of select="comment" /></b>
522
<xsl:apply-templates select="plots" />
526
<xsl:template match="subruns">
528
<xsl:apply-templates select="subrun" />
532
<xsl:template match="/result">
533
<div style="margin: 10px">
535
<xsl:when test="Error">
537
<xsl:value-of select="Error" />
540
<xsl:apply-templates select="run" />
541
<xsl:apply-templates select="subruns" />