pytrms 0.2.1__py3-none-any.whl → 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytrms/__init__.py +17 -46
- pytrms/_base/__init__.py +24 -0
- pytrms/_base/ioniclient.py +32 -0
- pytrms/_base/mqttclient.py +106 -0
- pytrms/_version.py +26 -0
- pytrms/clients/__init__.py +29 -3
- pytrms/clients/db_api.py +186 -0
- pytrms/clients/dirigent.py +169 -0
- pytrms/clients/modbus.py +495 -0
- pytrms/clients/mqtt.py +773 -0
- pytrms/clients/ssevent.py +82 -0
- pytrms/compose/__init__.py +2 -0
- pytrms/compose/composition.py +207 -0
- pytrms/data/IoniTofPrefs.ini +113 -0
- pytrms/data/ParaIDs.csv +731 -0
- pytrms/helpers.py +3 -6
- pytrms/instrument.py +51 -110
- pytrms/measurement.py +129 -48
- pytrms/peaktable.py +499 -0
- pytrms/plotting/__init__.py +4 -0
- pytrms/plotting/plotting.py +27 -0
- pytrms/readers/__init__.py +4 -0
- pytrms/readers/ionitof_reader.py +481 -0
- pytrms/tracebuffer.py +33 -8
- pytrms-0.9.0.dist-info/METADATA +19 -0
- pytrms-0.9.0.dist-info/RECORD +29 -0
- {pytrms-0.2.1.dist-info → pytrms-0.9.0.dist-info}/WHEEL +1 -1
- pytrms/clients/mockclient.py +0 -612
- pytrms/reader.py +0 -173
- pytrms/testing/__init__.py +0 -14
- pytrms/testing/response_TRACES_webAPI.txt +0 -556
- pytrms-0.2.1.dist-info/METADATA +0 -16
- pytrms-0.2.1.dist-info/RECORD +0 -15
- {pytrms-0.2.1.dist-info → pytrms-0.9.0.dist-info}/LICENSE +0 -0
pytrms/clients/mockclient.py
DELETED
|
@@ -1,612 +0,0 @@
|
|
|
1
|
-
import time
|
|
2
|
-
import json
|
|
3
|
-
from itertools import repeat
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
example_response = """{
|
|
7
|
-
"TimeCycle": {
|
|
8
|
-
"Cycle": 0,
|
|
9
|
-
"OverallCycle": 0,
|
|
10
|
-
"AbsTime": 0,
|
|
11
|
-
"RelTime": 0
|
|
12
|
-
},
|
|
13
|
-
"raw": [],
|
|
14
|
-
"corr": [],
|
|
15
|
-
"conc": [],
|
|
16
|
-
"CalcTraces": [],
|
|
17
|
-
"AddData": [
|
|
18
|
-
{
|
|
19
|
-
"Name": "TOFSupply",
|
|
20
|
-
"Desc": [
|
|
21
|
-
"TPS_Lens1_Set",
|
|
22
|
-
"TPS_Lens1_Act",
|
|
23
|
-
"TPS_Lens2_Set",
|
|
24
|
-
"TPS_Lens2_Act",
|
|
25
|
-
"TPS_Lens3_Set",
|
|
26
|
-
"TPS_Lens3_Act",
|
|
27
|
-
"TPS_Lens4_Set",
|
|
28
|
-
"TPS_Lens4_Act",
|
|
29
|
-
"TPS_Lens5_Set",
|
|
30
|
-
"TPS_Lens5_Act",
|
|
31
|
-
"TPS_Lens6_Set",
|
|
32
|
-
"TPS_Lens6_Act",
|
|
33
|
-
"TPS_Lens7_Set",
|
|
34
|
-
"TPS_Lens7_Act",
|
|
35
|
-
"TPS_LensesEn_Act",
|
|
36
|
-
"TPS_Push_L_Set",
|
|
37
|
-
"TPS_Push_L_Act",
|
|
38
|
-
"TPS_Push_H_Set",
|
|
39
|
-
"TPS_Push_H_Act",
|
|
40
|
-
"TPS_Pull_L_Set",
|
|
41
|
-
"TPS_Pull_L_Act",
|
|
42
|
-
"TPS_Pull_H_Set",
|
|
43
|
-
"TPS_Pull_H_Act",
|
|
44
|
-
"TPS_Push_L_En_Act",
|
|
45
|
-
"TPS_Push_H_En_Act",
|
|
46
|
-
"TPS_Pull_L_En_Act",
|
|
47
|
-
"TPS_Pull_H_En_Act",
|
|
48
|
-
"TPS_I-Push L_Act",
|
|
49
|
-
"TPS_I-Push H_Act",
|
|
50
|
-
"TPS_I-Pull L_Act",
|
|
51
|
-
"TPS_I-Pull H_Act",
|
|
52
|
-
"TPS_Grid_Set",
|
|
53
|
-
"TPS_Grid_Act",
|
|
54
|
-
"TPS_Cage_Set",
|
|
55
|
-
"TPS_Cage_Act",
|
|
56
|
-
"TPS_Refl_Grid_Set",
|
|
57
|
-
"TPS_Refl_Grid_Act",
|
|
58
|
-
"TPS_Refl_Back_Set",
|
|
59
|
-
"TPS_Refl_Back_Act",
|
|
60
|
-
"TPS_MCP_F_Set",
|
|
61
|
-
"TPS_MCP_F_Act",
|
|
62
|
-
"TPS_MCP_B_Set",
|
|
63
|
-
"TPS_MCP_B_Act",
|
|
64
|
-
"TPS_Grid_En_Act",
|
|
65
|
-
"TPS_Cage_En_Act",
|
|
66
|
-
"TPS_ReflGrid_En_Act",
|
|
67
|
-
"TPS_ReflBack_En_Act",
|
|
68
|
-
"TPS_MCP_F_En_Act",
|
|
69
|
-
"TPS_MCP_B_En_Act",
|
|
70
|
-
"TPS_I-Grid_Act",
|
|
71
|
-
"TPS_I-Cage_Act",
|
|
72
|
-
"TPS_I-Refl. Grid_Act",
|
|
73
|
-
"TPS_I-Refl. Back_Act",
|
|
74
|
-
"TPS_I-MCP F_Act",
|
|
75
|
-
"TPS_I-MCP B_Act",
|
|
76
|
-
"TPS_Hex1Offset_Set",
|
|
77
|
-
"TPS_Hex1Offset_Act",
|
|
78
|
-
"TPS_Hex1Enabled_Set",
|
|
79
|
-
"TPS_Hex1Enabled_Act",
|
|
80
|
-
"TPS_Hex1Ampl_Set",
|
|
81
|
-
"TPS_Hex1Ampl_Act"
|
|
82
|
-
],
|
|
83
|
-
"Units": [
|
|
84
|
-
"V",
|
|
85
|
-
"V",
|
|
86
|
-
"V",
|
|
87
|
-
"V",
|
|
88
|
-
"V",
|
|
89
|
-
"V",
|
|
90
|
-
"V",
|
|
91
|
-
"V",
|
|
92
|
-
"V",
|
|
93
|
-
"V",
|
|
94
|
-
"V",
|
|
95
|
-
"V",
|
|
96
|
-
"V",
|
|
97
|
-
"V",
|
|
98
|
-
"",
|
|
99
|
-
"V",
|
|
100
|
-
"V",
|
|
101
|
-
"V",
|
|
102
|
-
"V",
|
|
103
|
-
"V",
|
|
104
|
-
"V",
|
|
105
|
-
"V",
|
|
106
|
-
"V",
|
|
107
|
-
"",
|
|
108
|
-
"",
|
|
109
|
-
"",
|
|
110
|
-
"",
|
|
111
|
-
"mA",
|
|
112
|
-
"mA",
|
|
113
|
-
"mA",
|
|
114
|
-
"mA",
|
|
115
|
-
"V",
|
|
116
|
-
"V",
|
|
117
|
-
"V",
|
|
118
|
-
"V",
|
|
119
|
-
"V",
|
|
120
|
-
"V",
|
|
121
|
-
"V",
|
|
122
|
-
"V",
|
|
123
|
-
"V",
|
|
124
|
-
"V",
|
|
125
|
-
"V",
|
|
126
|
-
"V",
|
|
127
|
-
"",
|
|
128
|
-
"",
|
|
129
|
-
"",
|
|
130
|
-
"",
|
|
131
|
-
"",
|
|
132
|
-
"",
|
|
133
|
-
"\u00c2\u00b5A",
|
|
134
|
-
"\u00c2\u00b5A",
|
|
135
|
-
"\u00c2\u00b5A",
|
|
136
|
-
"\u00c2\u00b5A",
|
|
137
|
-
"\u00c2\u00b5A",
|
|
138
|
-
"\u00c2\u00b5A",
|
|
139
|
-
"V",
|
|
140
|
-
"V",
|
|
141
|
-
"",
|
|
142
|
-
"",
|
|
143
|
-
"mA",
|
|
144
|
-
"mA"
|
|
145
|
-
],
|
|
146
|
-
"Data": [
|
|
147
|
-
100,
|
|
148
|
-
99,
|
|
149
|
-
45,
|
|
150
|
-
45,
|
|
151
|
-
109.99998474121094,
|
|
152
|
-
109,
|
|
153
|
-
192,
|
|
154
|
-
190,
|
|
155
|
-
52,
|
|
156
|
-
52,
|
|
157
|
-
26,
|
|
158
|
-
26,
|
|
159
|
-
50,
|
|
160
|
-
50,
|
|
161
|
-
1,
|
|
162
|
-
37.000099182128906,
|
|
163
|
-
37,
|
|
164
|
-
720,
|
|
165
|
-
719,
|
|
166
|
-
50,
|
|
167
|
-
50,
|
|
168
|
-
600,
|
|
169
|
-
600,
|
|
170
|
-
1,
|
|
171
|
-
1,
|
|
172
|
-
1,
|
|
173
|
-
1,
|
|
174
|
-
0,
|
|
175
|
-
0,
|
|
176
|
-
0,
|
|
177
|
-
0,
|
|
178
|
-
1700,
|
|
179
|
-
1614,
|
|
180
|
-
3000,
|
|
181
|
-
2846,
|
|
182
|
-
690,
|
|
183
|
-
655,
|
|
184
|
-
808.999755859375,
|
|
185
|
-
768,
|
|
186
|
-
5300,
|
|
187
|
-
5032,
|
|
188
|
-
1950.402099609375,
|
|
189
|
-
1965,
|
|
190
|
-
1,
|
|
191
|
-
1,
|
|
192
|
-
1,
|
|
193
|
-
1,
|
|
194
|
-
1,
|
|
195
|
-
1,
|
|
196
|
-
6,
|
|
197
|
-
71,
|
|
198
|
-
100,
|
|
199
|
-
171,
|
|
200
|
-
17,
|
|
201
|
-
123,
|
|
202
|
-
0,
|
|
203
|
-
0,
|
|
204
|
-
0,
|
|
205
|
-
0,
|
|
206
|
-
0,
|
|
207
|
-
0
|
|
208
|
-
]
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"Name": "DataCollection",
|
|
212
|
-
"Desc": [
|
|
213
|
-
"ACQ_SRV_SpecTime_ms_Set",
|
|
214
|
-
"ACQ_SRV_MassCal_a_Act",
|
|
215
|
-
"ACQ_SRV_MassCal_b_Act",
|
|
216
|
-
"ACQ_SRV_AutoCalOnOff_Set",
|
|
217
|
-
"ACQ_SRV_AutoCalPeriod_sec_Set"
|
|
218
|
-
],
|
|
219
|
-
"Units": [
|
|
220
|
-
" ",
|
|
221
|
-
" ",
|
|
222
|
-
" ",
|
|
223
|
-
"",
|
|
224
|
-
""
|
|
225
|
-
],
|
|
226
|
-
"Data": [
|
|
227
|
-
1000,
|
|
228
|
-
6929.77099609375,
|
|
229
|
-
1569.69482421875,
|
|
230
|
-
1,
|
|
231
|
-
20
|
|
232
|
-
]
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"Name": "PTR-Reaction",
|
|
236
|
-
"Desc": [
|
|
237
|
-
"Udrift_Act",
|
|
238
|
-
"p-Drift_Act",
|
|
239
|
-
"T-Drift_Act",
|
|
240
|
-
"E/N_Act",
|
|
241
|
-
"PrimIon_Act",
|
|
242
|
-
"TransSet_Act"
|
|
243
|
-
],
|
|
244
|
-
"Units": [
|
|
245
|
-
"V",
|
|
246
|
-
"mbar",
|
|
247
|
-
"\u00c2\u00b0C",
|
|
248
|
-
"Td",
|
|
249
|
-
"Idx",
|
|
250
|
-
"Idx"
|
|
251
|
-
],
|
|
252
|
-
"Data": [
|
|
253
|
-
480.867431640625,
|
|
254
|
-
2.305406332015991,
|
|
255
|
-
70.19999694824219,
|
|
256
|
-
139.5508575439453,
|
|
257
|
-
0,
|
|
258
|
-
0
|
|
259
|
-
]
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
"Name": "PTR-Instrument",
|
|
263
|
-
"Desc": [
|
|
264
|
-
"Us_Set",
|
|
265
|
-
"Us_Act",
|
|
266
|
-
"Uso_Set",
|
|
267
|
-
"Uso_Act",
|
|
268
|
-
"Udrift_Set",
|
|
269
|
-
"Udrift_Act",
|
|
270
|
-
"Udx_Set",
|
|
271
|
-
"Udx_Act",
|
|
272
|
-
"Ihc_Set",
|
|
273
|
-
"Ihc_Act",
|
|
274
|
-
"Source On/Off_Set",
|
|
275
|
-
"Source On/Off_Act",
|
|
276
|
-
"PrimIon_Set",
|
|
277
|
-
"PrimIon_Act",
|
|
278
|
-
"SV_Set",
|
|
279
|
-
"SV_Act",
|
|
280
|
-
"E/N_Set",
|
|
281
|
-
"E/N_Act",
|
|
282
|
-
"p-Foreline_Set",
|
|
283
|
-
"p-Foreline_Act",
|
|
284
|
-
"p-Drift_Set",
|
|
285
|
-
"p-Drift_Act",
|
|
286
|
-
"p-TofLens_Set",
|
|
287
|
-
"p-TofLens_Act",
|
|
288
|
-
"p-TOF_Set",
|
|
289
|
-
"p-TOF_Act",
|
|
290
|
-
"H2O_Set",
|
|
291
|
-
"H2O_Act",
|
|
292
|
-
"PC_Set",
|
|
293
|
-
"PC_Act",
|
|
294
|
-
"FCinlet_Set",
|
|
295
|
-
"FCinlet_Act",
|
|
296
|
-
"NO_Set",
|
|
297
|
-
"NO_Act",
|
|
298
|
-
"Preset_Act",
|
|
299
|
-
"Temp: T-Drift_Set",
|
|
300
|
-
"Temp: T-Drift_Act",
|
|
301
|
-
"Temp: T-Inlet_Set",
|
|
302
|
-
"Temp: T-Inlet_Act",
|
|
303
|
-
"Temp: T-Opt1_Set",
|
|
304
|
-
"Temp: T-Opt1_Act",
|
|
305
|
-
"Temp: PerMasCal_Set",
|
|
306
|
-
"Temp: PerMasCal_Act",
|
|
307
|
-
"Drift_Set",
|
|
308
|
-
"Drift_Act",
|
|
309
|
-
"Drift_Set",
|
|
310
|
-
"Drift_Act",
|
|
311
|
-
"Drift: Telectronics_Set",
|
|
312
|
-
"Drift: Telectronics_Act",
|
|
313
|
-
"Drift: Tmotor_Set",
|
|
314
|
-
"Drift: Tmotor_Act",
|
|
315
|
-
"Detection_Set",
|
|
316
|
-
"Detection_Act",
|
|
317
|
-
"Detection_Set",
|
|
318
|
-
"Detection_Act",
|
|
319
|
-
"Detection: Telectronics_Set",
|
|
320
|
-
"Detection: Telectronics_Act",
|
|
321
|
-
"Detection: Tmotor_Set",
|
|
322
|
-
"Detection: Tmotor_Act",
|
|
323
|
-
"HS_Set",
|
|
324
|
-
"HS_Act",
|
|
325
|
-
"HS_Set",
|
|
326
|
-
"HS_Act",
|
|
327
|
-
"HS: Telectronics_Set",
|
|
328
|
-
"HS: Telectronics_Act",
|
|
329
|
-
"HS: Tmotor_Set",
|
|
330
|
-
"HS: Tmotor_Act",
|
|
331
|
-
"DPS_Pdrift_Ctrl_OnOff_Set",
|
|
332
|
-
"DPS_Pdrift_Ctrl_OnOff_Act",
|
|
333
|
-
"DPS_Pdrift_Ctrl_Val_Set",
|
|
334
|
-
"DPS_Pdrift_Ctrl_Val_Act"
|
|
335
|
-
],
|
|
336
|
-
"Units": [
|
|
337
|
-
"V",
|
|
338
|
-
"V",
|
|
339
|
-
"V",
|
|
340
|
-
"V",
|
|
341
|
-
"V",
|
|
342
|
-
"V",
|
|
343
|
-
"V",
|
|
344
|
-
"V",
|
|
345
|
-
"mA",
|
|
346
|
-
"mA",
|
|
347
|
-
"",
|
|
348
|
-
"",
|
|
349
|
-
"Idx",
|
|
350
|
-
"Idx",
|
|
351
|
-
"%",
|
|
352
|
-
"%",
|
|
353
|
-
"Td",
|
|
354
|
-
"Td",
|
|
355
|
-
"mbar",
|
|
356
|
-
"mbar",
|
|
357
|
-
"mbar",
|
|
358
|
-
"mbar",
|
|
359
|
-
"mbar",
|
|
360
|
-
"mbar",
|
|
361
|
-
"mbar",
|
|
362
|
-
"mbar",
|
|
363
|
-
"sccm ",
|
|
364
|
-
"sccm ",
|
|
365
|
-
"mbar(a)",
|
|
366
|
-
"mbar(a)",
|
|
367
|
-
"sccm ",
|
|
368
|
-
"sccm ",
|
|
369
|
-
"sccm ",
|
|
370
|
-
"sccm ",
|
|
371
|
-
"Idx",
|
|
372
|
-
"\u00c2\u00b0C",
|
|
373
|
-
"\u00c2\u00b0C",
|
|
374
|
-
"\u00c2\u00b0C",
|
|
375
|
-
"\u00c2\u00b0C",
|
|
376
|
-
"\u00c2\u00b0C",
|
|
377
|
-
"\u00c2\u00b0C",
|
|
378
|
-
"\u00c2\u00b0C",
|
|
379
|
-
"\u00c2\u00b0C",
|
|
380
|
-
"Hz",
|
|
381
|
-
"Hz",
|
|
382
|
-
"A",
|
|
383
|
-
"A",
|
|
384
|
-
"\u00c2\u00b0C",
|
|
385
|
-
"\u00c2\u00b0C",
|
|
386
|
-
"\u00c2\u00b0C",
|
|
387
|
-
"\u00c2\u00b0C",
|
|
388
|
-
"Hz",
|
|
389
|
-
"Hz",
|
|
390
|
-
"A",
|
|
391
|
-
"A",
|
|
392
|
-
"\u00c2\u00b0C",
|
|
393
|
-
"\u00c2\u00b0C",
|
|
394
|
-
"\u00c2\u00b0C",
|
|
395
|
-
"\u00c2\u00b0C",
|
|
396
|
-
"Hz",
|
|
397
|
-
"Hz",
|
|
398
|
-
"A",
|
|
399
|
-
"A",
|
|
400
|
-
"\u00c2\u00b0C",
|
|
401
|
-
"\u00c2\u00b0C",
|
|
402
|
-
"\u00c2\u00b0C",
|
|
403
|
-
"\u00c2\u00b0C",
|
|
404
|
-
"0/1",
|
|
405
|
-
"0/1",
|
|
406
|
-
"mbar",
|
|
407
|
-
"mbar"
|
|
408
|
-
],
|
|
409
|
-
"Data": [
|
|
410
|
-
140,
|
|
411
|
-
135.4322509765625,
|
|
412
|
-
80,
|
|
413
|
-
78.55672454833984,
|
|
414
|
-
480,
|
|
415
|
-
480.867431640625,
|
|
416
|
-
34,
|
|
417
|
-
32.611846923828125,
|
|
418
|
-
4,
|
|
419
|
-
4.023482799530029,
|
|
420
|
-
1,
|
|
421
|
-
1,
|
|
422
|
-
0,
|
|
423
|
-
0,
|
|
424
|
-
59,
|
|
425
|
-
59,
|
|
426
|
-
139.5508575439453,
|
|
427
|
-
139.5508575439453,
|
|
428
|
-
0,
|
|
429
|
-
4.874532699584961,
|
|
430
|
-
0,
|
|
431
|
-
2.305406332015991,
|
|
432
|
-
0,
|
|
433
|
-
3.095457941526547e-05,
|
|
434
|
-
0,
|
|
435
|
-
7.551057592536381e-07,
|
|
436
|
-
6,
|
|
437
|
-
6.000076770782471,
|
|
438
|
-
246.40625,
|
|
439
|
-
246.4048614501953,
|
|
440
|
-
0,
|
|
441
|
-
0,
|
|
442
|
-
0,
|
|
443
|
-
0,
|
|
444
|
-
110,
|
|
445
|
-
70,
|
|
446
|
-
70.19999694824219,
|
|
447
|
-
80,
|
|
448
|
-
850,
|
|
449
|
-
60,
|
|
450
|
-
850,
|
|
451
|
-
60,
|
|
452
|
-
59.900001525878906,
|
|
453
|
-
900,
|
|
454
|
-
900,
|
|
455
|
-
NaN,
|
|
456
|
-
0.9300000071525574,
|
|
457
|
-
NaN,
|
|
458
|
-
52,
|
|
459
|
-
NaN,
|
|
460
|
-
50,
|
|
461
|
-
1500,
|
|
462
|
-
1500,
|
|
463
|
-
NaN,
|
|
464
|
-
0.7300000190734863,
|
|
465
|
-
NaN,
|
|
466
|
-
45,
|
|
467
|
-
NaN,
|
|
468
|
-
45,
|
|
469
|
-
1500,
|
|
470
|
-
1500,
|
|
471
|
-
NaN,
|
|
472
|
-
0.6600000262260437,
|
|
473
|
-
NaN,
|
|
474
|
-
48,
|
|
475
|
-
NaN,
|
|
476
|
-
43,
|
|
477
|
-
1,
|
|
478
|
-
1,
|
|
479
|
-
2.299999952316284,
|
|
480
|
-
2.3050248622894287
|
|
481
|
-
]
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
"Name": "PTR-Misc",
|
|
485
|
-
"Desc": [
|
|
486
|
-
"AI1_Act",
|
|
487
|
-
"AI2_Act",
|
|
488
|
-
"DI1_Act",
|
|
489
|
-
"DI2_Act",
|
|
490
|
-
"AO1_Set",
|
|
491
|
-
"AO2_Set",
|
|
492
|
-
"DO1_Set",
|
|
493
|
-
"DO2_Set",
|
|
494
|
-
"DO3_Set",
|
|
495
|
-
"DO4_Set"
|
|
496
|
-
],
|
|
497
|
-
"Units": [
|
|
498
|
-
"",
|
|
499
|
-
"",
|
|
500
|
-
"",
|
|
501
|
-
"",
|
|
502
|
-
"V",
|
|
503
|
-
"V",
|
|
504
|
-
"",
|
|
505
|
-
"",
|
|
506
|
-
"",
|
|
507
|
-
""
|
|
508
|
-
],
|
|
509
|
-
"Data": [
|
|
510
|
-
0.001831110566854477,
|
|
511
|
-
0.0006103701889514923,
|
|
512
|
-
0,
|
|
513
|
-
0,
|
|
514
|
-
0,
|
|
515
|
-
0,
|
|
516
|
-
0,
|
|
517
|
-
0,
|
|
518
|
-
0,
|
|
519
|
-
0
|
|
520
|
-
]
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
"Name": "Automation",
|
|
524
|
-
"Desc": [
|
|
525
|
-
"AUTO_StepNumber",
|
|
526
|
-
"AUTO_RunNumber",
|
|
527
|
-
"AUTO_UseMean",
|
|
528
|
-
"AUTO_StartCycleMean",
|
|
529
|
-
"AUTO_StopCycleMean",
|
|
530
|
-
"AME_ActionNumber",
|
|
531
|
-
"AME_UserNumber",
|
|
532
|
-
"AME_StepNumber",
|
|
533
|
-
"AME_RunNumber"
|
|
534
|
-
],
|
|
535
|
-
"Units": [
|
|
536
|
-
"Number",
|
|
537
|
-
"Number",
|
|
538
|
-
"Number",
|
|
539
|
-
"Number",
|
|
540
|
-
"Number",
|
|
541
|
-
"Number",
|
|
542
|
-
"Number",
|
|
543
|
-
"Number",
|
|
544
|
-
"Number"
|
|
545
|
-
],
|
|
546
|
-
"Data": [
|
|
547
|
-
1,
|
|
548
|
-
552,
|
|
549
|
-
1,
|
|
550
|
-
5213,
|
|
551
|
-
5541,
|
|
552
|
-
3,
|
|
553
|
-
0,
|
|
554
|
-
1,
|
|
555
|
-
552
|
|
556
|
-
]
|
|
557
|
-
}
|
|
558
|
-
],
|
|
559
|
-
"CalcTracesNames": [],
|
|
560
|
-
"masses": []
|
|
561
|
-
}"""
|
|
562
|
-
|
|
563
|
-
class MockClient:
|
|
564
|
-
'''
|
|
565
|
-
Mock out all server connections for testing.
|
|
566
|
-
'''
|
|
567
|
-
def __init__(self, host='localhost', port=8002):
|
|
568
|
-
self.host = host
|
|
569
|
-
self.port = port
|
|
570
|
-
self.running = False
|
|
571
|
-
self.cycle = 0
|
|
572
|
-
|
|
573
|
-
@property
|
|
574
|
-
def baseurl(self):
|
|
575
|
-
return f'http://{self.host}:{self.port}/Ic_WebAPI'
|
|
576
|
-
|
|
577
|
-
def get(self, varname):
|
|
578
|
-
return "{" + varname + ": 42}"
|
|
579
|
-
|
|
580
|
-
def get_many(self, varnames):
|
|
581
|
-
mock = dict(zip(varnames, repeat(42)))
|
|
582
|
-
return str(mock)
|
|
583
|
-
|
|
584
|
-
def get_traces(self):
|
|
585
|
-
if self.running:
|
|
586
|
-
self.cycle += 1
|
|
587
|
-
|
|
588
|
-
response = json.loads(example_response)
|
|
589
|
-
response['TimeCycle']['Cycle'] = self.cycle
|
|
590
|
-
response['TimeCycle']['OverallCycle'] = self.cycle
|
|
591
|
-
|
|
592
|
-
return json.dumps(response)
|
|
593
|
-
|
|
594
|
-
def set(self, varname, value):
|
|
595
|
-
return "kruxlwuxl"
|
|
596
|
-
|
|
597
|
-
def set_many(self, key_value_pairs):
|
|
598
|
-
return "kruxlwuxl"
|
|
599
|
-
|
|
600
|
-
def set_filename(self, filename):
|
|
601
|
-
return "kruxlwuxl"
|
|
602
|
-
|
|
603
|
-
def start_measurement(self, filename=''):
|
|
604
|
-
time.sleep(1.2)
|
|
605
|
-
self.running = True
|
|
606
|
-
return "kruxlwuxl"
|
|
607
|
-
|
|
608
|
-
def stop_measurement(self):
|
|
609
|
-
time.sleep(1.2)
|
|
610
|
-
self.running = False
|
|
611
|
-
return "kruxlwuxl"
|
|
612
|
-
|