-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesign.html
433 lines (401 loc) · 28.1 KB
/
design.html
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>NXDL extensions for data sources — NeXDaTaS 1.0.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Project goals" href="project_goals.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="_static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.4.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
</head><body>
<div id="navbar" class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
NeXDaTaS</a>
<span class="navbar-text navbar-version pull-left"><b>1.0</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="index.html">Site <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="project_goals.html">Project goals</a></li>
<li class="toctree-l1"><a class="reference internal" href="project_goals.html#the-importance-of-the-client">The importance of the client</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">NXDL extensions for data sources</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#the-strategy-tag">The <code class="docutils literal notranslate"><span class="pre"><strategy></span></code> tag</a></li>
<li class="toctree-l2"><a class="reference internal" href="#the-datasource-tag">The <code class="docutils literal notranslate"><span class="pre"><datasource></span></code> tag</a></li>
<li class="toctree-l2"><a class="reference internal" href="#client-datasource"><em>CLIENT</em> datasource</a></li>
<li class="toctree-l2"><a class="reference internal" href="#tango-datasource"><em>TANGO</em> datasource</a></li>
<li class="toctree-l2"><a class="reference internal" href="#db-datasource"><em>DB</em> datasource</a></li>
<li class="toctree-l2"><a class="reference internal" href="#pyeval-datasource"><em>PYEVAL</em> datasource</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="#sequence-diagrams">Sequence diagrams</a></li>
</ul>
</ul>
</li>
<li class="dropdown">
<a role="button"
id="dLabelLocalToc"
data-toggle="dropdown"
data-target="#"
href="#">Page <b class="caret"></b></a>
<ul class="dropdown-menu localtoc"
role="menu"
aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">NXDL extensions for data sources</a><ul>
<li><a class="reference internal" href="#the-strategy-tag">The <code class="docutils literal notranslate"><span class="pre"><strategy></span></code> tag</a></li>
<li><a class="reference internal" href="#the-datasource-tag">The <code class="docutils literal notranslate"><span class="pre"><datasource></span></code> tag</a></li>
<li><a class="reference internal" href="#client-datasource"><em>CLIENT</em> datasource</a><ul>
<li><a class="reference internal" href="#record"><code class="docutils literal notranslate"><span class="pre"><record></span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#tango-datasource"><em>TANGO</em> datasource</a><ul>
<li><a class="reference internal" href="#device"><code class="docutils literal notranslate"><span class="pre"><device></span></code></a></li>
<li><a class="reference internal" href="#id1"><code class="docutils literal notranslate"><span class="pre"><record></span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#db-datasource"><em>DB</em> datasource</a><ul>
<li><a class="reference internal" href="#database"><code class="docutils literal notranslate"><span class="pre"><database></span></code></a></li>
<li><a class="reference internal" href="#query"><code class="docutils literal notranslate"><span class="pre"><query></span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#pyeval-datasource"><em>PYEVAL</em> datasource</a><ul>
<li><a class="reference internal" href="#datasource"><code class="docutils literal notranslate"><span class="pre"><datasource></span></code></a></li>
<li><a class="reference internal" href="#result"><code class="docutils literal notranslate"><span class="pre"><result></span></code></a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#sequence-diagrams">Sequence diagrams</a></li>
</ul>
</ul>
</li>
<li>
<a href="project_goals.html" title="Previous Chapter: Project goals"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">« Project goals</span>
</a>
</li>
</ul>
<form class="navbar-form navbar-right" action="search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="body col-md-12 content" role="main">
<section id="nxdl-extensions-for-data-sources">
<h1>NXDL extensions for data sources<a class="headerlink" href="#nxdl-extensions-for-data-sources" title="Permalink to this heading">¶</a></h1>
<p>In order to describe various data sources <a class="reference external" href="http://download.nexusformat.org/sphinx/nxdl.html">the NXDL
standard</a> has been
extended by XML tags listed below. Thus, <code class="docutils literal notranslate"><span class="pre"><strategy</span> <span class="pre">/></span></code> and
<code class="docutils literal notranslate"><span class="pre"><datasource</span> <span class="pre">/></span></code> tags can be situated inside</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre"><field</span> <span class="pre">/></span></code> – for its value</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre"><attribute</span> <span class="pre">/></span></code> – for its value</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre"><dim</span> <span class="pre">/></span></code> – for its value (from nxswriter v1.7.0)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre"><link</span> <span class="pre">/></span></code> – for its target (from nxswriter v1.9.0)</p></li>
</ul>
<p>The other ones are nested inside <code class="docutils literal notranslate"><span class="pre"><datasource/></span></code> tag.</p>
<section id="the-strategy-tag">
<h2>The <code class="docutils literal notranslate"><span class="pre"><strategy></span></code> tag<a class="headerlink" href="#the-strategy-tag" title="Permalink to this heading">¶</a></h2>
<p>The <strong>strategy</strong> tag defines when and in which way the data is stored.
An example of usage:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><field</span><span class="w"> </span><span class="na">name=</span><span class="s">"energy"</span><span class="w"> </span><span class="na">type=</span><span class="s">"NX_FLOAT"</span><span class="w"> </span><span class="na">units=</span><span class="s">"GeV"</span><span class="w"> </span><span class="nt">></span>
<span class="w"> </span><span class="nt"><strategy</span><span class="w"> </span><span class="na">mode=</span><span class="s">"STEP"</span><span class="w"> </span><span class="na">trigger=</span><span class="s">"trigger1"</span><span class="w"> </span><span class="nt">/></span>
<span class="w"> </span><span class="nt"><datasource</span><span class="w"> </span><span class="na">type=</span><span class="s">"CLIENT"</span><span class="nt">></span>
<span class="w"> </span><span class="nt"><record</span><span class="w"> </span><span class="na">name=</span><span class="s">"counter_1"</span><span class="nt">/></span>
<span class="w"> </span><span class="nt"></datasource></span>
<span class="nt"></field></span>
</pre></div>
</div>
<p>The tag can have the following attributes:</p>
<ul class="simple">
<li><p><strong>mode</strong> specifies when the data is fetched, i.e.</p>
<ul>
<li><p><em>INIT</em> during opening a new entry</p></li>
<li><p><em>STEP</em> when the <em>record()</em> command is performed</p></li>
<li><p><em>FINAL</em> at the time of closing the entry</p></li>
<li><p><em>POSTRUN</em> during post-processing stage</p></li>
<li><p><em>CONFIG</em> before opening a new entry (used only for dimensions)</p></li>
</ul>
</li>
<li><p><strong>trigger</strong> stands for the name of the related trigger in asynchronous <em>STEP</em> mode (optional)</p></li>
<li><p><strong>grows</strong> selects which a field dimension grows of in the STEP mode. The default growing dimension is the first one, i.e. grows=1 (optional)</p></li>
<li><p><strong>compression</strong> specifies filterID if data is compressed (optional)</p>
<ul>
<li><p>integer filterID</p></li>
<li><p><em>true</em> data going to be compressed with deflate</p></li>
<li><p><em>false</em> data stored without compression (default)</p></li>
</ul>
</li>
<li><p><strong>compression_opts</strong> integer compression options (optional)</p>
<ul>
<li><p>list of integer compression options separated by comma</p></li>
</ul>
</li>
<li><p><strong>rate</strong> compression rate for deflate (optional)</p>
<ul>
<li><p>from <em>0</em> to <em>9</em></p></li>
</ul>
</li>
<li><p><strong>shuffle</strong> compression shuffle (optional)</p>
<ul>
<li><p><em>true</em> shuffle enabled (default)</p></li>
<li><p><em>false</em> shuffle disabled</p></li>
</ul>
</li>
<li><p><strong>canfail</strong> specifies if during reading data exception should be thrown (optional)</p>
<ul>
<li><p><em>false</em> on error exception is raised (default)</p></li>
<li><p><em>true</em> on error</p></li>
</ul>
</li>
</ul>
<p>warning info is printed and the record is filled by a maximum value for
the record type</p>
<p>The <strong>content</strong> of the strategy tags is an label describing data merged
into the H5 file by a post-processing program.</p>
<p>An example of usage:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><field</span><span class="w"> </span><span class="na">name=</span><span class="s">"energy"</span><span class="w"> </span><span class="na">type=</span><span class="s">"NX_FLOAT"</span><span class="w"> </span><span class="na">units=</span><span class="s">"GeV"</span><span class="w"> </span><span class="nt">></span>
<span class="w"> </span><span class="nt"><strategy</span><span class="w"> </span><span class="na">mode=</span><span class="s">"POSTRUN"</span><span class="w"> </span><span class="nt">></span>
<span class="w"> </span>http://haso.desy.de:/data/energy.dat
<span class="w"> </span><span class="nt"></strategy></span>
<span class="nt"></field></span>
</pre></div>
</div>
</section>
<section id="the-datasource-tag">
<h2>The <code class="docutils literal notranslate"><span class="pre"><datasource></span></code> tag<a class="headerlink" href="#the-datasource-tag" title="Permalink to this heading">¶</a></h2>
<p>The <strong>datasource</strong> tag specifies a type of the used data sources. They
can be one of built types, i.e. <em>CLIENT</em>, <em>TANGO</em>, <em>DB</em>, <em>PYEVAL</em> or
external ones – defined in external python package and registered via
JSON data.</p>
<p>The <code class="docutils literal notranslate"><span class="pre"><datasouce></span></code> tag acquires the following attributes:</p>
<ul class="simple">
<li><p><strong>type</strong> related to a type of data source with possible values:</p>
<ul>
<li><p><em>CLIENT</em> for communication with client via JSON strings</p></li>
<li><p><em>TANGO</em> for taking data from Tango servers</p></li>
<li><p><em>DB</em> for fetching data from databases</p></li>
<li><p><em>PYEVAL</em> for evaluating data from other data sources by python script</p></li>
<li><p><em>other type name</em> of data source which has been registered via JSON data.</p></li>
</ul>
</li>
<li><p><strong>name</strong> datasource name (optional)</p></li>
</ul>
</section>
<section id="client-datasource">
<h2><em>CLIENT</em> datasource<a class="headerlink" href="#client-datasource" title="Permalink to this heading">¶</a></h2>
<p>The CLIENT datasource allows to read data from client JSON strings. It
should contain a <code class="docutils literal notranslate"><span class="pre"><record</span> <span class="pre">/></span></code> tag. An example of usage:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><datasource</span><span class="w"> </span><span class="na">type=</span><span class="s">"CLIENT"</span><span class="w"> </span><span class="na">name=</span><span class="s">"exp_c01"</span><span class="nt">></span>
<span class="w"> </span><span class="nt"><record</span><span class="w"> </span><span class="na">name=</span><span class="s">"counter_1"</span><span class="nt">/></span>
<span class="nt"></datasource></span>
</pre></div>
</div>
<section id="record">
<h3><code class="docutils literal notranslate"><span class="pre"><record></span></code><a class="headerlink" href="#record" title="Permalink to this heading">¶</a></h3>
<p>The <strong>record</strong> tag defines the fetched data by its name. It has an
attrbute</p>
<ul class="simple">
<li><p><strong>name</strong> which for the <em>CLIENT</em> data source type denotes a name of the data in the JSON string.</p></li>
</ul>
<p>An example of usage:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><record</span><span class="w"> </span><span class="na">name=</span><span class="s">"Position"</span><span class="nt">/></span>
</pre></div>
</div>
</section>
</section>
<section id="tango-datasource">
<h2><em>TANGO</em> datasource<a class="headerlink" href="#tango-datasource" title="Permalink to this heading">¶</a></h2>
<p>The TANGO datasource allows to read data from other TANGO devices. It
should contain <code class="docutils literal notranslate"><span class="pre"><device/></span></code> and <code class="docutils literal notranslate"><span class="pre"><record/></span></code> tags. An example of
usage:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><datasource</span><span class="w"> </span><span class="na">type=</span><span class="s">"TANGO"</span><span class="nt">></span>
<span class="w"> </span><span class="nt"><device</span><span class="w"> </span><span class="na">hostname=</span><span class="s">"haso.desy.de"</span><span class="w"> </span><span class="na">member=</span><span class="s">"attribute"</span><span class="w"> </span><span class="na">name=</span><span class="s">"p09/motor/exp.01"</span><span class="w"> </span><span class="na">port=</span><span class="s">"10000"</span><span class="w"> </span><span class="na">encoding=</span><span class="s">"LIMA_VIDEO_IMAGE"</span><span class="nt">/></span>
<span class="w"> </span><span class="nt"><record</span><span class="w"> </span><span class="na">name=</span><span class="s">"Position"</span><span class="nt">/></span>
<span class="nt"></datasource></span>
</pre></div>
</div>
<section id="device">
<h3><code class="docutils literal notranslate"><span class="pre"><device></span></code><a class="headerlink" href="#device" title="Permalink to this heading">¶</a></h3>
<p>The <strong>device</strong> tag describes the Tango device which is used to get the
data. It has the following attributes:</p>
<ul class="simple">
<li><p><strong>name</strong> corresponding to a name of the Tango device</p></li>
<li><p><strong>member</strong> defining a type of the class member, i.e.</p>
<ul>
<li><p><em>attribute</em> an attribute to read</p></li>
<li><p><em>command</em> a result of a command to take</p></li>
<li><p><em>property</em> a property to read</p></li>
</ul>
</li>
<li><p><strong>hostname</strong> a name of the host with the Tango device server (optional)</p></li>
<li><p><strong>port</strong> a port number related to the Tango device server (optional)</p></li>
<li><p><strong>encoding</strong> a label defining a required decoder for <code class="docutils literal notranslate"><span class="pre">DevEncoded</span></code> data (optional)</p></li>
<li><p><strong>group</strong> tango group name (optional)</p></li>
</ul>
<p>If <strong>group</strong> attribute is defined data of the same group is read
simultaneously and only ones during one experimental step.</p>
</section>
<section id="id1">
<h3><code class="docutils literal notranslate"><span class="pre"><record></span></code><a class="headerlink" href="#id1" title="Permalink to this heading">¶</a></h3>
<p>The <strong>record</strong> tag defines the fetched data by its name. It has an
attrbute</p>
<ul class="simple">
<li><p><strong>name</strong> which for the <em>TANGO</em> data source type a name of the tango class member.</p></li>
</ul>
</section>
</section>
<section id="db-datasource">
<h2><em>DB</em> datasource<a class="headerlink" href="#db-datasource" title="Permalink to this heading">¶</a></h2>
<p>The DB datasource allows to read data from accessible databases. It
should contain <code class="docutils literal notranslate"><span class="pre"><database</span> <span class="pre">/></span></code> and <code class="docutils literal notranslate"><span class="pre"><query></span></code> tags. An example of
usage:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><datasource</span><span class="w"> </span><span class="na">type=</span><span class="s">"DB"</span><span class="nt">></span>
<span class="w"> </span><span class="nt"><database</span><span class="w"> </span><span class="na">dbname=</span><span class="s">"tango"</span><span class="w"> </span><span class="na">dbtype=</span><span class="s">"MYSQL"</span><span class="w"> </span><span class="na">hostname=</span><span class="s">"haso.desy.de"</span><span class="nt">/></span>
<span class="w"> </span><span class="nt"><query</span><span class="w"> </span><span class="na">format=</span><span class="s">"SPECTRUM"</span><span class="nt">></span>
<span class="w"> </span>SELECT<span class="w"> </span>pid<span class="w"> </span>FROM<span class="w"> </span>device<span class="w"> </span>limit<span class="w"> </span>10
<span class="w"> </span><span class="nt"></query></span>
<span class="nt"></datasource></span>
</pre></div>
</div>
<section id="database">
<h3><code class="docutils literal notranslate"><span class="pre"><database></span></code><a class="headerlink" href="#database" title="Permalink to this heading">¶</a></h3>
<p>The <strong>database</strong> tag specifies parameters to connect to the required
database. It acquires the attirbutes</p>
<ul class="simple">
<li><p><strong>dbtype</strong> describing a type of the database, i.e.</p>
<ul>
<li><p><em>ORACLE</em> an ORACLE database</p></li>
<li><p><em>MYSQL</em> a MySQL database</p></li>
<li><p><em>PGSQL</em> a PostgreSQL database</p></li>
</ul>
</li>
<li><p><strong>dbname</strong> denoting a name of the database (optional)</p></li>
<li><p><strong>hostname</strong> being a name of the host with the database (optional)</p></li>
<li><p><strong>port</strong> corresponding to a port number related to the database (optional)</p></li>
<li><p><strong>user</strong> denoting a user name (optional)</p></li>
<li><p><strong>passwd</strong> being a user password (optional)</p></li>
<li><p><strong>mycnf</strong> defining a location of the my.cnf file with MySQL database access configuration (optional)</p></li>
<li><p><strong>node</strong> corresponding to a node parameter for the ORACLE database(optional)</p></li>
</ul>
<p>The <strong>content</strong> of the database tag defines Oracle DSN string (optional)</p>
</section>
<section id="query">
<h3><code class="docutils literal notranslate"><span class="pre"><query></span></code><a class="headerlink" href="#query" title="Permalink to this heading">¶</a></h3>
<p>The <strong>query</strong> tag defines the database query which fetches the data. It
has one attribute</p>
<ul class="simple">
<li><p><strong>format</strong> which specifies a dimension of the fetch data, i.e.</p>
<ul>
<li><p><em>SCALAR</em> corresponds to 0-dimensional data, e.g. a separate numerical value or string</p></li>
<li><p><em>SPECTRUM</em> is related to 1-dimensional data, e.g. a list of numerical values or strings</p></li>
<li><p><em>IMAGE</em> describes 2-dimensional data, i.e. a table of specific type values, e.g. a table of strings</p></li>
</ul>
</li>
</ul>
<p>The <strong>content</strong> of the query tags is the SQL query</p>
<p>Another example of usage:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><datasource</span><span class="w"> </span><span class="na">type=</span><span class="s">"DB"</span><span class="nt">></span>
<span class="w"> </span><span class="nt"><database</span><span class="w"> </span><span class="na">dbname=</span><span class="s">"mydb"</span><span class="w"> </span><span class="na">dbtype=</span><span class="s">"PGSQL"</span><span class="nt">/></span>
<span class="w"> </span><span class="nt"><query</span><span class="w"> </span><span class="na">format=</span><span class="s">"IMAGE"</span><span class="nt">></span>
<span class="w"> </span>SELECT<span class="w"> </span>*<span class="w"> </span>FROM<span class="w"> </span>weather<span class="w"> </span>limit<span class="w"> </span>3
<span class="w"> </span><span class="nt"></query></span>
<span class="nt"></datasource></span>
</pre></div>
</div>
</section>
</section>
<section id="pyeval-datasource">
<h2><em>PYEVAL</em> datasource<a class="headerlink" href="#pyeval-datasource" title="Permalink to this heading">¶</a></h2>
<p>The PYEVAL datasource allows to read data from other datasources and
evaluate it by a user python script. An example of usage:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt"><datasource</span><span class="w"> </span><span class="na">type=</span><span class="s">"PYEVAL"</span><span class="nt">></span>
<span class="w"> </span><span class="nt"><datasource</span><span class="w"> </span><span class="na">type=</span><span class="s">"TANGO"</span><span class="w"> </span><span class="na">name=</span><span class="s">"position"</span><span class="nt">></span>
<span class="w"> </span><span class="nt"><device</span><span class="w"> </span><span class="na">hostname=</span><span class="s">"haso.desy.de"</span><span class="w"> </span><span class="na">member=</span><span class="s">"attribute"</span><span class="w"> </span><span class="na">name=</span><span class="s">"p09/motor/exp.01"</span><span class="w"> </span><span class="na">port=</span><span class="s">"10000"</span><span class="nt">/></span>
<span class="w"> </span><span class="nt"><record</span><span class="w"> </span><span class="na">name=</span><span class="s">"Position"</span><span class="nt">/></span>
<span class="w"> </span><span class="nt"></datasource></span>
<span class="w"> </span><span class="nt"><datasource</span><span class="w"> </span><span class="na">type=</span><span class="s">"CLIENT"</span><span class="w"> </span><span class="na">name=</span><span class="s">"shift"</span><span class="nt">></span>
<span class="w"> </span><span class="nt"><record</span><span class="w"> </span><span class="na">name=</span><span class="s">"exp_c01"</span><span class="nt">/></span>
<span class="w"> </span><span class="nt"></datasource></span>
<span class="w"> </span><span class="nt"><result</span><span class="w"> </span><span class="na">name=</span><span class="s">"finalposition"</span><span class="nt">></span>
<span class="w"> </span>ds.finalposition<span class="w"> </span>=<span class="w"> </span>ds.position<span class="w"> </span>+<span class="w"> </span>ds.shift
<span class="w"> </span><span class="nt"></result></span>
<span class="nt"></datasource></span>
</pre></div>
</div>
<section id="datasource">
<h3><code class="docutils literal notranslate"><span class="pre"><datasource></span></code><a class="headerlink" href="#datasource" title="Permalink to this heading">¶</a></h3>
<p>The PYEVAL datasource can contain other datasources. They have to have
defined name attributes. Those names with additional prefix ‘ds.’
correspond to input variable names from the python script, i.e.
ds.<strong>name</strong>.</p>
</section>
<section id="result">
<h3><code class="docutils literal notranslate"><span class="pre"><result></span></code><a class="headerlink" href="#result" title="Permalink to this heading">¶</a></h3>
<p>The <strong>result</strong> contains python script which evaluates input data. It has
the following attribute:
* <strong>name</strong> corresponding to a result name. It
is related to python script variable by <em>ds.**name**</em>. The default
value <strong>name</strong>=”result”. (optional)</p>
</section>
</section>
</section>
<section id="sequence-diagrams">
<h1>Sequence diagrams<a class="headerlink" href="#sequence-diagrams" title="Permalink to this heading">¶</a></h1>
<img alt="_images/basic_server_client_communication.png" src="_images/basic_server_client_communication.png" />
<img alt="_images/configuration.png" src="_images/configuration.png" />
<img alt="_images/recording_data.png" src="_images/recording_data.png" />
</section>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
© Copyright 2016, DESY, Jan Kotanski, Eugen Wintersberger, Halil Pasic, Maria-Teresa Núñez-Pardo-de-Vera.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 5.3.0.<br/>
</p>
</div>
</footer>
</body>
</html>