-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpd-ref.edn
204 lines (202 loc) · 7.17 KB
/
mpd-ref.edn
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
{:_id "mpd-ref",
:_rev "6-b4475e103286fba67eb4ad849270841d",
:Mp
{:Date [{:Type "created", :Value "2020-01-11"}],
:Name "wait",
:Description
"Simple measurement programm definition (mpd) which serves as a reference for documentation and testing.",
:Standard "NN",
;; -------------------------------------------------------
;; Exchange section
;; -------------------------------------------------------
;; Endpoint for exchanging data and information.
;; Internal and external use is intendet.
:Exchange
;; one level deep nested values ..
{:A {:Type "ref", :Unit "Pa", :Value 100.0},
;; .. or flat values are valid
:B "token",
:Target_pressure
{:Selected 1,
:Select [{:value 10.0} {:value 100.0} {:value 1000.0}],
:Unit "Pa"},
:Ref_gas
{:Selected "N2",
:Select
[{:value "N2", :display "Stickstoff"}
{:value "Ar", :display "Argon"}
{:value "Ne", :display "Neon"}
{:value "Kr", :display "Krypton"}
{:value "Xe", :display "Xenon"}
{:value "He", :display "Helium"}
{:value "H2", :display "Wasserstoff"}],
:Ready false}},
;; -------------------------------------------------------
;; Container section
;; -------------------------------------------------------
:Container
[;; Containers are fixed sequences of things to do.
;; In opposit to definitions containers have no conditions structure.
;; 0. container:
{:Description "Container just waits parallel and sequential.",
;; The ctrl endpoint of the first container.
;; All values are ok. The values start, stop and mon will start stop and mon.
;; mon ... relaunch the container if all tasks are executed
;; void ... just some value (as good as foo or bar), causes no action.
:Ctrl "ready",
:Title "multiple wait tasks",
;; Element is inteded for filtering the exchange interface:
;; which elements should be vissible at a gui of this
;; container
:Element ["A"],
;; The definition of what schould happen after what.
;; The "array of arrays"-structure controlls what happens
;; parallel and what sequential.
:Definition
[
;; First: start a wait task with 1000 ms waittime.
;; At the same time start a wait task with 2000 ms waittime.
[{:TaskName "Common-wait", :Replace {"@waittime" 1000}}
{:TaskName "Common-wait", :Replace {"@waittime" 2000}}]
[
;; After first step is executed: start 4 wait tasks
;; with 100 ms waittime, step is executed within 1000ms
{:TaskName "Common-wait", :Replace {"@waittime" 1000}}
{:TaskName "Common-wait", :Replace {"@waittime" 1000}}
{:TaskName "Common-wait", :Replace {"@waittime" 1000}}
{:TaskName "Common-wait", :Replace {"@waittime" 1000}}]
[{:TaskName "Common-wait", :Replace {"@waittime" 2000}}]]}
{ ;; 1. container
:Description "Container with one task only",
:Ctrl "ready",
:Title "container with single task",
:Element ["Target_pressure"],
:Definition
[[{:TaskName "Common-wait", :Replace {"@waittime" 1000}}]]}
;; 2. container
{:Description "Show case select feature",
:Ctrl "ready",
:Title "choose definition, run it",
:Element [],
:Definition
[[{:TaskName "Common-select_definition",
:Replace {"@definitionclass" "wait"}}]]}
;; 3. container
{:Description "Run a mpd (first container of ref).",
:Ctrl "ready",
:Title "run 1st container",
:Element ["Ref_gas"],
:Definition
[[{:TaskName "Common-run_mp",
:Replace
{"@conttitle" "multiple wait tasks" "@mpdef" "mpd-ref"}}]]}
;; 4. container
{:Description "Test read_exchange action.",
:Ctrl "ready",
:Title "read exchange.",
:Element [],
:Definition
[[{:TaskName "Common-simple_read_element",
:Replace
{"@docpath" "Measurement.Values.Pressure", "@exchpath" "A"}}]]}
;; 5. container
{:Description "Test anselm request.",
:Ctrl "ready",
:Title "anselm.",
:Element [],
:Definition [[{:TaskName "Common-anselm_get_dut_max"}]]}
;; 6. container
{:Description
"Test date and time and the ability to parallel write to database docs.",
:Ctrl "ready",
:Title "date & time",
:Element [],
:Definition
[[{:TaskName "Common-get_date",
:Replace
{"@docpath" "Calibration.Measurement.Date"
"@type" "tethys-test"}}
{:TaskName "Common-get_time",
:Replace
{"@docpath" "Calibration.Measurement.AuxValues.Time"
"@type" "tethys-test"}}]]}
;; 7. container
{:Description "Message test.",
:Ctrl "ready",
:Title "message",
:Element [],
:Definition
[[{:TaskName "Common-message",
:Replace {"@message" "Lorem ipsum dolor sit amet."}}]]}
;; 8. container
{:Description "Add a document.",
:Ctrl "ready",
:Title "add doc.",
:Element [],
:Definition
[[{:TaskName "SE3_state-gen_state_doc"}]]}
;; 9. container
{:Description "Write date to exchange interface.",
:Ctrl "ready",
:Title "write exchange",
:Element [],
:Definition
[[{:TaskName "Common-exchange_value",
:Replace {"@exchpath" "C", "@value" "done"}}]]}
;; 10. container
{:Description "Replicate feature.",
:Ctrl "ready",
:Title "replicate",
:Element [],
:Definition
[[{:TaskName "Common-db_replicate"}]]}
;; 11. container
{:Description "Remove documents.",
:Ctrl "ready",
:Title "rm docs.",
:Element [],
:Definition
[[{:TaskName "Common-rm_db_docs"}]]}],
;; -------------------------------------------------------
;; Definitions section
;; -------------------------------------------------------
:Definitions
;; Several definitions with the same
;; class (here wait) are possible.
;; At Runtime: the first of matching
;; (see condition section) definition is started.
;; 1st wait definition
[{:DefinitionClass "wait",
:ShortDescr "waits 0.1 and 0.2s\n",
:Condition
[{:ExchangePath "A.Unit", :Methode "eq", :Value "Pa"}
{:ExchangePath "A.Value", :Methode "gt", :Value 133}],
:Definition
[[{:TaskName "Common-wait", :Replace {"@waittime" 100}}
{:TaskName "Common-wait", :Replace {"@waittime" 200}}]]}
;; 2nd wait definition
;; The conditions of this match the predefined
;; exchange values (see :Exchange section above)
{:DefinitionClass "wait",
:ShortDescr "waits 0.3 and 0.4s\n",
:Condition
[{:ExchangePath "A.Unit", :Methode "eq", :Value "Pa"}
{:ExchangePath "A.Value", :Methode "lt", :Value 133}],
;; The definition structure under definitions section
;; works the same as under container
:Definition
[[{:TaskName "Common-wait", :Replace {"@waittime" 300}}
{:TaskName "Common-wait", :Replace {"@waittime" 5000}}]]}
;; 3rd wait definition
{:DefinitionClass "wait",
:ShortDescr "waits 0.4 and 0.5s\n",
:Condition
[{:ExchangePath "A.Unit", :Methode "eq", :Value "Pa"}
{:ExchangePath "A.Value", :Methode "lt", :Value 13}],
:Definition
[[{:TaskName "Common-wait", :Replace {"@waittime" 400}}
{:TaskName "Common-wait", :Replace {"@waittime" 500}}]]}]
;; -------------------------------------------------------
;; Task section
;; -------------------------------------------------------
}}