2
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
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>
15
<xsl:if test="@run">kdb_run=<xsl:value-of select="@run" />&</xsl:if>
16
<xsl:if test="@hardware">kdb_hardware=<xsl:value-of select="@hardware" />&</xsl:if>
17
<xsl:text>name=</xsl:text><xsl:value-of select="@name" /><xsl:text>&</xsl:text>
20
<xsl:element name="a">
21
<xsl:attribute name="href">
22
<xsl:value-of select="$link" />
23
<xsl:text>type=plot</xsl:text>
25
<xsl:attribute name="target">_blank</xsl:attribute>
26
<xsl:element name="img">
27
<xsl:attribute name="src">
28
<xsl:value-of select="$link" />
29
<xsl:text>type=preview</xsl:text>
31
<xsl:attribute name="border">0</xsl:attribute>
32
<xsl:attribute name="alt">
33
<xsl:value-of select="." />
35
<xsl:attribute name="width">
36
<xsl:value-of select="$width" />
38
<xsl:attribute name="height">
39
<xsl:value-of select="$height" />
46
<xsl:template match="image" mode="small">
47
<xsl:call-template name="image">
48
<xsl:with-param name="width" select="'150'" />
49
<xsl:with-param name="height" select="'100'" />
53
<xsl:template match="image" mode="normal">
54
<xsl:call-template name="image">
55
<xsl:with-param name="width" select="'300'" />
56
<xsl:with-param name="height" select="'200'" />
60
<xsl:template match="image" mode="large">
61
<xsl:call-template name="image">
62
<xsl:with-param name="width" select="'600'" />
63
<xsl:with-param name="height" select="'400'" />
67
<xsl:template match="image" mode="table">
69
<xsl:apply-templates select="." mode="small" />
73
<xsl:template match="image" mode="title">
74
<th><xsl:value-of select="." /></th>
77
<xsl:template match="file">
79
<xsl:element name="a">
80
<xsl:attribute name="href">
81
<xsl:text>services/katrin.php?target=file</xsl:text>
82
<xsl:text>&kdb_download=yes</xsl:text>
84
<xsl:text>&kdb_run=</xsl:text>
85
<xsl:value-of select="@run" />
88
<xsl:text>&kdb_type=</xsl:text>
89
<xsl:value-of select="@type" />
91
<xsl:if test="@filename">
92
<xsl:text>&kdb_name=</xsl:text>
93
<xsl:value-of select="@name" />
95
<xsl:if test="@hardware">
96
<xsl:text>&kdb_hardware=</xsl:text>
97
<xsl:value-of select="@hardware" />
100
<xsl:value-of select="." />
102
<xsl:if test="@filesize">
103
<span style="font-size: small">
104
<xsl:text> (</xsl:text>
105
<xsl:value-of select="@filesize" />
106
<xsl:text>)</xsl:text>
112
<!-- ADEI links and images -->
113
<xsl:template match="adei">
114
<xsl:text>db_server=</xsl:text>
115
<xsl:value-of select="@server" />
116
<xsl:text>&db_name=</xsl:text>
117
<xsl:value-of select="@database" />
118
<xsl:text>&db_group=</xsl:text>
119
<xsl:value-of select="@group" />
120
<xsl:if test="@mask">
121
<xsl:text>&db_mask=</xsl:text>
122
<xsl:value-of select="@mask" />
124
<xsl:if test="@window">
125
<xsl:text>&window=</xsl:text>
126
<xsl:value-of select="@window" />
130
<xsl:template match="adeiimage" mode="image">
131
<xsl:variable name="url">
132
<xsl:apply-templates select="adei" />
135
<xsl:element name="a">
136
<xsl:attribute name="href">
137
<xsl:text>javascript:adei.config.Load('</xsl:text>
138
<xsl:value-of select="$url" />
139
<xsl:text>&module=graph&setup=katrin', true)</xsl:text>
141
<xsl:element name="img">
142
<xsl:attribute name="src">
143
<xsl:text>services/getimage.php?</xsl:text>
144
<xsl:value-of select="$url" />
145
<xsl:text>&hide_axes=1&precision=LOW&width=</xsl:text>
146
<xsl:value-of select="@width" />
147
<xsl:text>&height=</xsl:text>
148
<xsl:value-of select="@height" />
150
<xsl:attribute name="alt">
151
<xsl:value-of select="@text" />
153
<xsl:attribute name="width">
154
<xsl:value-of select="@width" />
156
<xsl:attribute name="height">
157
<xsl:value-of select="@height" />
159
<xsl:attribute name="border">
160
<xsl:text>0</xsl:text>
167
<xsl:template match="adeiimage" mode="title">
168
<th><xsl:value-of select="@text" /></th>
171
<xsl:template match="plots">
172
<table style="margin:10px 0">
174
<xsl:apply-templates select="image" mode="title" />
177
<xsl:apply-templates select="image" mode="table" />
182
5
<xsl:template match="streams">
183
6
<xsl:for-each select="type">
184
7
<xsl:variable name="title">
205
28
<xsl:attribute name="title">
206
29
<xsl:value-of select="$title" />
208
<xsl:attribute name="style">
209
<xsl:text>margin: 0 5px</xsl:text>
31
<xsl:attribute name="style">
32
<xsl:text>margin: 0 5px; vertical-align: middle</xsl:text>
215
<xsl:template match="downloads">
217
<xsl:apply-templates select="file" />
220
<xsl:template match="parameters">
221
<xsl:if test="magnet_west or magnet_east">
222
<div style="background-color:#ccffcc">
223
<xsl:if test="magnet_west">
225
<b><xsl:value-of select="magnet_west" />A (<xsl:value-of select="field_west" />T)</b>
227
<xsl:if test="magnet_east">
229
<b><xsl:value-of select="magnet_east" />A (<xsl:value-of select="field_east" />T)</b>
233
<xsl:if test="det_ps or ps_egun">
235
<xsl:if test="det_ps">
238
<xsl:value-of select="det_ps" />
239
<xsl:text> </xsl:text>
242
<xsl:if test="ps_egun">
245
<xsl:value-of select="ps_egun" />
246
<xsl:text> </xsl:text>
251
<xsl:if test="t or s1 or s2 or s3 or s4 or d1 or d2">
252
<div style="background-color:#ffcc99">
256
<xsl:value-of select="t" />
257
<xsl:text> </xsl:text>
263
<xsl:value-of select="s1" />
264
<xsl:text> </xsl:text>
270
<xsl:value-of select="s2" />
271
<xsl:text> </xsl:text>
277
<xsl:value-of select="s3" />
278
<xsl:text> </xsl:text>
284
<xsl:value-of select="s4" />
285
<xsl:text> </xsl:text>
291
<xsl:value-of select="d1" />
292
<xsl:text> </xsl:text>
298
<xsl:value-of select="d2" />
299
<xsl:text> </xsl:text>
304
<xsl:if test="fug1 or fug2 or fug3 or fug4 or fug5">
305
<div style="background-color:#ffcc99">
308
<b><xsl:value-of select="fug1" />kV </b>
312
<b><xsl:value-of select="fug2" />kV </b>
316
<b><xsl:value-of select="fug3" />kV </b>
320
<b><xsl:value-of select="fug4" />kV </b>
324
<b><xsl:value-of select="fug5" />kV </b>
328
<xsl:if test="pressure">
329
<div style="background-color:#ffcc99">
331
<b><xsl:value-of select="pressure" />mbar </b>
334
<xsl:if test="egun_uv or egun_shutter or egun_hv or egun_x or egun_y">
335
<div style="background-color:#99ccff">
336
<xsl:if test="egun_uv">
339
<xsl:value-of select="egun_uv" />
340
<xsl:text> </xsl:text>
343
<xsl:if test="egun_shutter">
346
<xsl:value-of select="egun_shutter" />
347
<xsl:text> </xsl:text>
350
<xsl:if test="egun_hv">
352
<b><xsl:value-of select="egun_hv" />kV </b>
354
<xsl:if test="egun_x">
356
<b><xsl:value-of select="egun_x" />° </b>
358
<xsl:if test="egun_y">
360
<b><xsl:value-of select="egun_y" />° </b>
366
<xsl:template match="transmission">
369
<xsl:text>Transmission (</xsl:text>
370
<xsl:value-of select="@parameter" />
371
<xsl:text>):</xsl:text>
373
<xsl:apply-templates select="image" mode="large" />
377
<xsl:template match="parameter">
380
<xsl:text>Control parameter (</xsl:text>
381
<xsl:value-of select="@parameter" />
382
<xsl:text>):</xsl:text>
384
<xsl:apply-templates select="image" mode="normal" />
388
<xsl:template match="countrate">
391
<xsl:apply-templates select="image" mode="normal" />
395
<xsl:template match="run">
400
<h2>Run <xsl:value-of select="identifier" /></h2>
403
<a href="javascript:katrin.SetCustomProperties('kdb_run=')">
409
<td colspan="2" style="padding: 0 10px">
410
<xsl:apply-templates select="streams" />
414
<td rowspan="2" style="width:600px; padding: 0 10px 0 0">
415
<xsl:apply-templates select="plots/transmission" />
416
<div class="properties">
417
<div style="background-color:silver">
420
<xsl:value-of select="date" />
421
<xsl:text> </xsl:text>
424
<b><xsl:value-of select="start" /> - <xsl:value-of select="end" /></b>
426
<div style="background-color:#ffff99">
429
<xsl:value-of select="detector" />
430
<xsl:text> </xsl:text>
433
<b><xsl:value-of select="detector_x" />cm </b>
435
<b><xsl:value-of select="detector_y" />cm </b>
437
<b><xsl:value-of select="detector_z" />cm </b>
439
<div style="background-color:#ffff99">
442
<xsl:value-of select="configuration" />
443
<xsl:text> </xsl:text>
446
<b><xsl:value-of select="orca_version" /> </b>
448
<xsl:apply-templates select="parameters" />
449
<div style="background-color:black; color:white">
452
<div style="background-color:black; color:white">
453
<b><xsl:value-of select="comment" /></b>
458
<xsl:apply-templates select="plots/countrate" />
459
<xsl:apply-templates select="plots/parameter" />
460
<xsl:apply-templates select="downloads" />
464
<td style="vertical-align:bottom">
466
<xsl:if test="../subruns">
467
<a href="javascript:katrin.SetCustomProperties('kdb_subruns=0')">
471
<xsl:if test="not(../subruns)">
472
<a href="javascript:katrin.SetCustomProperties('kdb_subruns=1')">
482
<xsl:template match="subruns">
484
<xsl:apply-templates select="subrun" />
488
<xsl:template match="subrun">
489
<div style="margin: 20px 0">
490
<h4>Subrun <xsl:value-of select="identifier" /></h4>
491
<div class="properties" style="width:600px">
492
<div style="background-color:silver">
494
<b><xsl:value-of select="start" /> - <xsl:value-of select="end" /></b>
496
<xsl:apply-templates select="parameters" />
497
<div style="background-color:black; color:white">
500
<div style="background-color:black; color:white">
501
<b><xsl:value-of select="comment" /></b>
504
<xsl:apply-templates select="plots" />
508
38
<!-- Helper template for page links in last runs view -->
509
39
<xsl:template name="page_link">
510
40
<xsl:param name="page" />
102
<xsl:template match="status">
103
<xsl:variable name="color">
105
<xsl:when test=". = 'Ok'">
106
<xsl:text>#008000</xsl:text>
108
<xsl:when test=". = 'Error'">
109
<xsl:text>#800000</xsl:text>
112
<xsl:text>#000000</xsl:text>
117
<xsl:element name="span">
118
<xsl:attribute name="style">
119
<xsl:text>font-weight: bold; color: </xsl:text>
120
<xsl:value-of select="$color" />
122
<xsl:value-of select="." />
572
126
<!-- Template for runs list in last runs view -->
573
127
<xsl:template match="runs">
574
<script type="text/javascript">
575
filter.SetParameters(htmlEntityDecode('<xsl:value-of select="@parameters"/>'));
577
<div style="padding:25px">
580
<td style="text-align:left">
581
<xsl:call-template name="navigation" />
583
<td style="text-align:right">
584
<xsl:if test="string-length(@filter) > 0">
585
<a href="javascript:adei.OpenControl('filter')">
586
<xsl:text>Filter</xsl:text>
588
<xsl:text>: </xsl:text>
589
<span class="search">
590
<xsl:value-of select="@filter" />
594
<xsl:if test="string-length(@search) > 0">
595
<xsl:text>Search: "</xsl:text>
596
<span class="search">
597
<xsl:value-of select="@search" />
599
<xsl:text>" (</xsl:text>
600
<a href="javascript:katrin.SetCustomProperties('kdb_search=&kdb_date=')">
601
<xsl:text>Clear</xsl:text>
603
<xsl:text>)</xsl:text>
130
<td style="text-align:left">
131
<xsl:call-template name="navigation" />
133
<td style="text-align:right">
134
<xsl:if test="string-length(@filter) > 0">
135
<a href="javascript:adei.OpenControl('filter')">
136
<xsl:text>Filter</xsl:text>
138
<xsl:text>: </xsl:text>
139
<span class="search">
140
<xsl:value-of select="@filter" />
144
<xsl:if test="string-length(@search) > 0">
145
<xsl:text>Search: "</xsl:text>
146
<span class="search">
147
<xsl:value-of select="@search" />
149
<xsl:text>" (</xsl:text>
150
<a href="javascript:katrin.SetCustomProperties('kdb_search=&kdb_parameters=&kdb_date=')">
151
<xsl:text>Clear</xsl:text>
153
<xsl:text>)</xsl:text>
156
<xsl:if test="string-length(@window) > 0">
157
<xsl:text>Selected time window (</xsl:text>
158
<a href="javascript:katrin.SetCustomProperties('kdb_window=&kdb_date=')">
159
<xsl:text>Clear</xsl:text>
161
<xsl:text>)</xsl:text>
166
<xsl:if test="count(run) > 0">
167
<table class="border" border="1" cellspacing="0" cellpadding="5" width="100%">
169
<th class="border overview">Identifier</th>
170
<th class="border overview">Start (UTC)</th>
171
<th class="border overview">Duration</th>
172
<th class="border overview">Subruns</th>
173
<th class="border overview">Data</th>
174
<th class="border overview">Status</th>
175
<th class="border" style="width:100%">Comment</th>
608
<xsl:if test="count(run) > 0">
609
<table style="border:1px solid black; border-collapse: collapse; font-size: small" border="1" cellspacing="0" cellpadding="5" width="100%">
610
<tr style="background-color:silver">
611
<th class="overview">Identifier</th>
612
<th class="overview">Start (UTC)</th>
613
<th class="overview">Duration</th>
614
<th class="overview">Subruns</th>
615
<th class="overview">Data</th>
177
<xsl:for-each select="run">
179
<td class="border overview">
180
<xsl:element name="a">
181
<xsl:attribute name="href">
182
<xsl:text>javascript:katrin.SetCustomProperties('kdb_run=</xsl:text>
183
<xsl:value-of select="identifier" />
184
<xsl:text>&kdb_subruns=')</xsl:text>
186
<xsl:value-of select="identifier" />
189
<td class="border overview date">
190
<xsl:value-of select="start" />
192
<td class="border overview">
193
<xsl:value-of select="duration" />
195
<td class="border overview">
196
<xsl:value-of select="subruns" />
198
<td class="border overview">
199
<xsl:apply-templates select="streams" />
201
<td class="border overview">
202
<xsl:apply-templates select="status" />
204
<td class="border overview" style="text-align: left">
205
<xsl:value-of select="comment" />
618
<xsl:for-each select="run">
620
<td class="overview">
621
<xsl:element name="a">
622
<xsl:attribute name="href">
623
<xsl:text>javascript:katrin.SetCustomProperties('kdb_run=</xsl:text>
624
<xsl:value-of select="identifier" />
625
<xsl:text>&kdb_subruns=0')</xsl:text>
627
<xsl:value-of select="identifier" />
630
<td class="overview date">
631
<xsl:value-of select="start" />
633
<td class="overview">
634
<xsl:value-of select="duration" />
636
<td class="overview">
637
<xsl:value-of select="subruns" />
639
<td class="overview">
640
<xsl:apply-templates select="streams" />
642
<td class="overview" style="text-align: left">
643
<xsl:value-of select="comment" />
211
<xsl:if test="count(run) = 0">
212
<div>No runs found</div>
216
<td style="text-align:left">
217
<xsl:call-template name="navigation" />
219
<td style="text-align:right">
225
<xsl:template match="loading">
226
<script type="text/javascript">
227
adei.OpenControl('filter');
228
filter.SetSearch('<xsl:value-of select="@search"/>', '<xsl:value-of select="@parameters"/>', '<xsl:value-of select="@window"/>');
232
<xsl:template match="error">
233
<h3>Invalid filter</h3>
234
<p><xsl:value-of select="." /></p>
237
<xsl:template match="help">
238
<script type="text/javascript">
239
filter.FocusParameters();
241
<xsl:apply-templates select="error" />
242
<h3>Filter Description</h3>
243
<p>The run list can be filtered by defining a filter with predefined
245
<p>The general filter format is:</p>
246
<p class="code">parameter OP value[, parameter OP value, ...]</p>
249
<span class="variable">OP</span> can be one of <, <=, =,
253
<span class="variable">value</span> is a numeric value, scientific
257
<span class="variable">parameter</span> is a predefined parameter
258
name. Currently the following parameters are defined:
259
<div style="padding=5px">
260
<table class="border" border="1">
262
<th class="border">Parameter</th>
263
<th class="border">Description</th>
649
<xsl:if test="count(run) = 0">
650
<div>No runs found</div>
654
<td style="text-align:left">
655
<xsl:call-template name="navigation" />
657
<td style="text-align:right">
664
<xsl:template match="loading">
665
<script type="text/javascript">
666
filter.SetSearch(htmlEntityDecode('<xsl:value-of select="@search"/>'));
265
<xsl:for-each select="parameter">
268
<xsl:value-of select="name" />
271
<xsl:value-of select="description" />
279
<p>If more than one filter is specified they are combined using an AND
670
283
<xsl:template match="/result">
671
<div style="margin-left: 20px">
284
<div style="margin: 10px">
673
286
<xsl:when test="Error">