ariel-tcu 0.17.2__py3-none-any.whl → 0.17.4__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.
- ariel_tcu/settings.yaml +4 -0
- {ariel_tcu-0.17.2.dist-info → ariel_tcu-0.17.4.dist-info}/METADATA +1 -1
- ariel_tcu-0.17.4.dist-info/RECORD +16 -0
- {ariel_tcu-0.17.2.dist-info → ariel_tcu-0.17.4.dist-info}/entry_points.txt +3 -0
- egse/ariel/tcu/__init__.py +12 -7
- egse/ariel/tcu/tcu.py +108 -16
- egse/ariel/tcu/tcu_cmd_utils.py +65 -8
- egse/ariel/tcu/tcu_cs.py +56 -32
- egse/ariel/tcu/tcu_devif.py +27 -0
- egse/ariel/tcu/tcu_protocol.py +2 -2
- egse/ariel/tcu/tcu_ui.py +693 -0
- ariel_tcu-0.17.2.dist-info/RECORD +0 -15
- {ariel_tcu-0.17.2.dist-info → ariel_tcu-0.17.4.dist-info}/WHEEL +0 -0
egse/ariel/tcu/tcu.py
CHANGED
|
@@ -13,13 +13,15 @@ Reference documents:
|
|
|
13
13
|
- RD02: ARIEL TCU Data Handling (ARIEL-IEEC-PL-TN-007), v1.0
|
|
14
14
|
- RD03: TCU code provided by Vladimiro Noce (priv. comm.)
|
|
15
15
|
- RD04: ARIEL Telescope Control Unit Design Description Document (ARIEL-IEEC-PL-DD-001), v1.10
|
|
16
|
-
- RD05: ARIEL TCU FW Architecture Design(ARIEL-IEEC-PL-DD-002), v1.5
|
|
16
|
+
- RD05: ARIEL TCU FW Architecture Design (ARIEL-IEEC-PL-DD-002), v1.5
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
import logging
|
|
20
|
+
|
|
20
21
|
from serial.tools import list_ports
|
|
21
22
|
|
|
22
|
-
from egse.ariel.tcu import PROXY_TIMEOUT, SERVICE_TYPE, TcuMode
|
|
23
|
+
from egse.ariel.tcu import PROXY_TIMEOUT, SERVICE_TYPE, TcuMode, PROTOCOL, HOSTNAME, COMMANDING_PORT
|
|
24
|
+
from egse.ariel.tcu.tcu_cmd_utils import general_cmd, m2md_cmd, tsm_cmd, hk_cmd
|
|
23
25
|
from egse.ariel.tcu.tcu_cmd_utils import (
|
|
24
26
|
set_tcu_mode,
|
|
25
27
|
tcu_simulated,
|
|
@@ -100,15 +102,14 @@ from egse.ariel.tcu.tcu_cmd_utils import (
|
|
|
100
102
|
vhk_ths_ret,
|
|
101
103
|
hk_acq_counter,
|
|
102
104
|
)
|
|
103
|
-
|
|
105
|
+
from egse.ariel.tcu.tcu_devif import TcuDeviceInterface, TcuHexInterface
|
|
104
106
|
from egse.device import DeviceInterface
|
|
105
107
|
from egse.mixin import dynamic_command, CommandType, DynamicCommandMixin
|
|
106
108
|
from egse.proxy import DynamicProxy
|
|
107
|
-
from egse.ariel.tcu.tcu_devif import TcuDeviceInterface
|
|
108
109
|
from egse.registry.client import RegistryClient
|
|
109
110
|
from egse.zmq_ser import connect_address
|
|
110
111
|
|
|
111
|
-
|
|
112
|
+
LOGGER = logging.getLogger("egse.ariel.tcu")
|
|
112
113
|
|
|
113
114
|
|
|
114
115
|
def get_all_serial_ports() -> list:
|
|
@@ -129,6 +130,7 @@ def get_all_serial_ports() -> list:
|
|
|
129
130
|
class TcuInterface(DeviceInterface):
|
|
130
131
|
# General commands
|
|
131
132
|
|
|
133
|
+
@general_cmd()
|
|
132
134
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tcu_firmware_id)
|
|
133
135
|
def tcu_firmware_id(self):
|
|
134
136
|
"""Selects the Instrument Control Unit (ICU) channel and returns the firmware version.
|
|
@@ -139,6 +141,7 @@ class TcuInterface(DeviceInterface):
|
|
|
139
141
|
|
|
140
142
|
pass
|
|
141
143
|
|
|
144
|
+
@general_cmd()
|
|
142
145
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_tcu_mode)
|
|
143
146
|
def get_tcu_mode(self):
|
|
144
147
|
"""Returns the current mode of the Ariel TCU.
|
|
@@ -154,6 +157,7 @@ class TcuInterface(DeviceInterface):
|
|
|
154
157
|
|
|
155
158
|
pass
|
|
156
159
|
|
|
160
|
+
@general_cmd()
|
|
157
161
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_tcu_mode)
|
|
158
162
|
def set_tcu_mode(self, tcu_mode: TcuMode | int = TcuMode.IDLE):
|
|
159
163
|
"""Selects the Ariel TCU working mode.
|
|
@@ -167,6 +171,7 @@ class TcuInterface(DeviceInterface):
|
|
|
167
171
|
|
|
168
172
|
pass
|
|
169
173
|
|
|
174
|
+
@general_cmd()
|
|
170
175
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tcu_status)
|
|
171
176
|
def tcu_status(self):
|
|
172
177
|
"""Returns the TCU status.
|
|
@@ -194,6 +199,7 @@ class TcuInterface(DeviceInterface):
|
|
|
194
199
|
|
|
195
200
|
pass
|
|
196
201
|
|
|
202
|
+
@general_cmd()
|
|
197
203
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tcu_simulated)
|
|
198
204
|
def tcu_simulated(self, cargo2: int):
|
|
199
205
|
"""Changes a TCU sub-system in simulated mode.
|
|
@@ -216,6 +222,7 @@ class TcuInterface(DeviceInterface):
|
|
|
216
222
|
"""
|
|
217
223
|
pass
|
|
218
224
|
|
|
225
|
+
@general_cmd()
|
|
219
226
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=restart_links_period_latch)
|
|
220
227
|
def restart_links_period_latch(self, cargo2: int):
|
|
221
228
|
"""Re-starts the link period latch.
|
|
@@ -231,10 +238,12 @@ class TcuInterface(DeviceInterface):
|
|
|
231
238
|
|
|
232
239
|
pass
|
|
233
240
|
|
|
241
|
+
@general_cmd()
|
|
234
242
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_restart_links_period)
|
|
235
243
|
def get_restart_links_period(self):
|
|
236
244
|
pass
|
|
237
245
|
|
|
246
|
+
@general_cmd()
|
|
238
247
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_restart_links_period)
|
|
239
248
|
def set_restart_links_period(self, link_period: int = 0xFFFF):
|
|
240
249
|
"""Re-start both links if no message is received after the given link period +1s.
|
|
@@ -246,6 +255,7 @@ class TcuInterface(DeviceInterface):
|
|
|
246
255
|
|
|
247
256
|
# M2MD commands
|
|
248
257
|
|
|
258
|
+
@m2md_cmd()
|
|
249
259
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=ope_mng_command)
|
|
250
260
|
def ope_mng_command(self, axis: CommandAddress | str | int, cargo2: int = 0x0002):
|
|
251
261
|
"""Commands the action to the SENER motor driver IP core for the given M2MD axis.
|
|
@@ -263,6 +273,7 @@ class TcuInterface(DeviceInterface):
|
|
|
263
273
|
|
|
264
274
|
pass
|
|
265
275
|
|
|
276
|
+
@m2md_cmd()
|
|
266
277
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=ope_mng_event_clear_protect_flag)
|
|
267
278
|
def ope_mng_event_clear_protect_flag(self, axis: CommandAddress | str | int, cargo2: int = 0xAAAA):
|
|
268
279
|
"""Clears the event register protection flag.
|
|
@@ -274,6 +285,7 @@ class TcuInterface(DeviceInterface):
|
|
|
274
285
|
|
|
275
286
|
pass
|
|
276
287
|
|
|
288
|
+
@m2md_cmd()
|
|
277
289
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=ope_mng_event_clear)
|
|
278
290
|
def ope_mng_event_clear(self, axis: CommandAddress | str | int, cargo2: int = 0x0001):
|
|
279
291
|
"""Clears the event register for the given M2MD axis.
|
|
@@ -285,6 +297,7 @@ class TcuInterface(DeviceInterface):
|
|
|
285
297
|
|
|
286
298
|
pass
|
|
287
299
|
|
|
300
|
+
@m2md_cmd()
|
|
288
301
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=ope_mng_status)
|
|
289
302
|
def ope_mng_status(self, axis: CommandAddress | str | int):
|
|
290
303
|
"""Returns the current status of the motor for the given M2MD axis.
|
|
@@ -299,6 +312,7 @@ class TcuInterface(DeviceInterface):
|
|
|
299
312
|
|
|
300
313
|
pass
|
|
301
314
|
|
|
315
|
+
@m2md_cmd()
|
|
302
316
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=ope_mng_event_reg)
|
|
303
317
|
def ope_mng_event_reg(self, axis: CommandAddress | str | int):
|
|
304
318
|
"""Returns the list of all events since wake-up or the last clear event.
|
|
@@ -312,58 +326,72 @@ class TcuInterface(DeviceInterface):
|
|
|
312
326
|
|
|
313
327
|
pass
|
|
314
328
|
|
|
329
|
+
@m2md_cmd()
|
|
315
330
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_acq_curr_off_corr)
|
|
316
331
|
def get_acq_curr_off_corr(self, axis: CommandAddress | str | int):
|
|
317
332
|
pass
|
|
318
333
|
|
|
334
|
+
@m2md_cmd()
|
|
319
335
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_acq_curr_off_corr)
|
|
320
336
|
def set_acq_curr_off_corr(self, axis: CommandAddress | str | int, cargo2: int = 0x03FB):
|
|
321
337
|
pass
|
|
322
338
|
|
|
339
|
+
@m2md_cmd()
|
|
323
340
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_acq_curr_gain_corr)
|
|
324
341
|
def get_acq_curr_gain_corr(self, axis: CommandAddress | str | int):
|
|
325
342
|
pass
|
|
326
343
|
|
|
344
|
+
@m2md_cmd()
|
|
327
345
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_acq_curr_gain_corr)
|
|
328
346
|
def set_acq_curr_gain_corr(self, axis: CommandAddress | str | int, cargo2: int = 0x074C):
|
|
329
347
|
pass
|
|
330
348
|
|
|
349
|
+
@m2md_cmd()
|
|
331
350
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=acq_axis_a_curr_read)
|
|
332
351
|
def acq_axis_a_curr_read(self, axis: CommandAddress | str | int):
|
|
333
352
|
pass
|
|
334
353
|
|
|
354
|
+
@m2md_cmd()
|
|
335
355
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=acq_axis_b_curr_read)
|
|
336
356
|
def acq_axis_b_curr_read(self, axis: CommandAddress | str | int):
|
|
337
357
|
pass
|
|
338
358
|
|
|
359
|
+
@m2md_cmd()
|
|
339
360
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=acq_ave_lpf_en)
|
|
340
361
|
def acq_ave_lpf_en(self, axis: CommandAddress | str | int, cargo2: int = 0x0001):
|
|
341
362
|
pass
|
|
342
363
|
|
|
364
|
+
@m2md_cmd()
|
|
343
365
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=acq_ovc_cfg_filter)
|
|
344
366
|
def acq_ovc_cfg_filter(self, axis: CommandAddress | str | int, cargo2: int = 0):
|
|
345
367
|
pass
|
|
346
368
|
|
|
369
|
+
@m2md_cmd()
|
|
347
370
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=acq_avc_filt_time)
|
|
348
371
|
def acq_avc_filt_time(self, axis: CommandAddress | str | int, cargo2: int = 0):
|
|
349
372
|
pass
|
|
350
373
|
|
|
374
|
+
@m2md_cmd()
|
|
351
375
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=acq_average_type)
|
|
352
376
|
def acq_average_type(self, axis: CommandAddress | str | int, cargo2: int = 0x0000):
|
|
353
377
|
pass
|
|
354
378
|
|
|
379
|
+
@m2md_cmd()
|
|
355
380
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=acq_spk_filt_counter_lim)
|
|
356
381
|
def acq_spk_filt_counter_lim(self, axis: CommandAddress | str | int, cargo2: int = 0x0001):
|
|
357
382
|
pass
|
|
358
383
|
|
|
384
|
+
@m2md_cmd()
|
|
359
385
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=acq_spk_filt_incr_thr)
|
|
360
386
|
def acq_spk_filt_incr_thr(self, axis: CommandAddress | str | int, cargo2: int = 0x04C0):
|
|
361
387
|
pass
|
|
362
388
|
|
|
389
|
+
@m2md_cmd()
|
|
363
390
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_prof_gen_axis_step)
|
|
364
391
|
def get_prof_gen_axis_step(self, axis: CommandAddress | str | int):
|
|
365
392
|
pass
|
|
366
393
|
|
|
394
|
+
@m2md_cmd()
|
|
367
395
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_prof_gen_axis_step)
|
|
368
396
|
def set_prof_gen_axis_step(self, axis: CommandAddress | str | int, cargo2: int = 0x0480):
|
|
369
397
|
"""Axis position command for the given M2MD axis.
|
|
@@ -380,6 +408,7 @@ class TcuInterface(DeviceInterface):
|
|
|
380
408
|
|
|
381
409
|
pass
|
|
382
410
|
|
|
411
|
+
@m2md_cmd()
|
|
383
412
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_prof_gen_axis_speed)
|
|
384
413
|
def get_prof_gen_axis_speed(self, axis: CommandAddress | str | int):
|
|
385
414
|
"""Returns the axis writing speed for the given M2MD axis.
|
|
@@ -389,23 +418,26 @@ class TcuInterface(DeviceInterface):
|
|
|
389
418
|
"""
|
|
390
419
|
pass
|
|
391
420
|
|
|
421
|
+
@m2md_cmd()
|
|
392
422
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_prof_gen_axis_speed)
|
|
393
|
-
def set_prof_gen_axis_speed(self, axis: CommandAddress | str | int,
|
|
423
|
+
def set_prof_gen_axis_speed(self, axis: CommandAddress | str | int, speed: int = 0x0177):
|
|
394
424
|
"""Axis velocity command for the given M2MD axis.
|
|
395
425
|
|
|
396
426
|
The cargo2 parameter denotes the desired velocity.
|
|
397
427
|
|
|
398
428
|
Args:
|
|
399
429
|
axis (CommandAddress | str | int): Axis to which the command is sent.
|
|
400
|
-
|
|
430
|
+
speed (int): Cargo 2 part of the command string.
|
|
401
431
|
"""
|
|
402
432
|
|
|
403
433
|
pass
|
|
404
434
|
|
|
435
|
+
@m2md_cmd()
|
|
405
436
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_prof_gen_axis_state_start)
|
|
406
437
|
def get_prof_gen_axis_state_start(self, axis: CommandAddress | str | int):
|
|
407
438
|
pass
|
|
408
439
|
|
|
440
|
+
@m2md_cmd()
|
|
409
441
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_prof_gen_axis_state_start)
|
|
410
442
|
def set_prof_gen_axis_state_start(self, axis: CommandAddress | str | int, cargo2: int = 0):
|
|
411
443
|
"""Changes the starting point of the magnetic state for the given M2MD axis.
|
|
@@ -418,6 +450,7 @@ class TcuInterface(DeviceInterface):
|
|
|
418
450
|
|
|
419
451
|
pass
|
|
420
452
|
|
|
453
|
+
@m2md_cmd()
|
|
421
454
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=sw_rs_xx_sw_rise)
|
|
422
455
|
def sw_rs_xx_sw_rise(self, axis: CommandAddress | str | int, position: int = 1):
|
|
423
456
|
"""Position switch rise.
|
|
@@ -432,6 +465,7 @@ class TcuInterface(DeviceInterface):
|
|
|
432
465
|
|
|
433
466
|
pass
|
|
434
467
|
|
|
468
|
+
@m2md_cmd()
|
|
435
469
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=sw_rs_xx_sw_fall)
|
|
436
470
|
def sw_rs_xx_sw_fall(self, axis: CommandAddress | str | int, position: int = 1):
|
|
437
471
|
"""Position switch fall.
|
|
@@ -448,6 +482,7 @@ class TcuInterface(DeviceInterface):
|
|
|
448
482
|
|
|
449
483
|
# TSM commands
|
|
450
484
|
|
|
485
|
+
@tsm_cmd()
|
|
451
486
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_latch)
|
|
452
487
|
def tsm_latch(self, cargo1: str | int, cargo2: int = 0):
|
|
453
488
|
"""Latches to allow the modification of the operation management register.
|
|
@@ -459,6 +494,7 @@ class TcuInterface(DeviceInterface):
|
|
|
459
494
|
|
|
460
495
|
pass
|
|
461
496
|
|
|
497
|
+
@tsm_cmd()
|
|
462
498
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_tsm_current_value)
|
|
463
499
|
def get_tsm_current_value(self):
|
|
464
500
|
"""Returns the TSM current.
|
|
@@ -468,6 +504,7 @@ class TcuInterface(DeviceInterface):
|
|
|
468
504
|
"""
|
|
469
505
|
pass
|
|
470
506
|
|
|
507
|
+
@tsm_cmd()
|
|
471
508
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_tsm_current_value)
|
|
472
509
|
def set_tsm_current_value(self, cargo1: int = 0, cargo2: int = 0):
|
|
473
510
|
"""Sets the TSM current value.
|
|
@@ -479,6 +516,7 @@ class TcuInterface(DeviceInterface):
|
|
|
479
516
|
|
|
480
517
|
pass
|
|
481
518
|
|
|
519
|
+
@tsm_cmd()
|
|
482
520
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_tsm_current_offset)
|
|
483
521
|
def get_tsm_current_offset(self):
|
|
484
522
|
"""Returns the TSM current offset.
|
|
@@ -489,6 +527,7 @@ class TcuInterface(DeviceInterface):
|
|
|
489
527
|
|
|
490
528
|
pass
|
|
491
529
|
|
|
530
|
+
@tsm_cmd()
|
|
492
531
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_tsm_current_offset)
|
|
493
532
|
def set_tsm_current_offset(self, cargo1: int = 0, cargo2: int = 0):
|
|
494
533
|
"""Sets the TSM current offset.
|
|
@@ -500,6 +539,7 @@ class TcuInterface(DeviceInterface):
|
|
|
500
539
|
|
|
501
540
|
pass
|
|
502
541
|
|
|
542
|
+
@tsm_cmd()
|
|
503
543
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_register_latch)
|
|
504
544
|
def tsm_adc_register_latch(self, cargo1: int = 0, cargo2: int = 0):
|
|
505
545
|
"""Re-starts the TSM ADC register latch.
|
|
@@ -511,6 +551,7 @@ class TcuInterface(DeviceInterface):
|
|
|
511
551
|
|
|
512
552
|
pass
|
|
513
553
|
|
|
554
|
+
@tsm_cmd()
|
|
514
555
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_id_register)
|
|
515
556
|
def tsm_adc_id_register(self):
|
|
516
557
|
"""Returns the content of the TSM ADC identifier register.
|
|
@@ -521,6 +562,7 @@ class TcuInterface(DeviceInterface):
|
|
|
521
562
|
|
|
522
563
|
pass
|
|
523
564
|
|
|
565
|
+
@tsm_cmd()
|
|
524
566
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_configuration_register)
|
|
525
567
|
def tsm_adc_configuration_register(self):
|
|
526
568
|
"""Returns the content of the TSM ADC configuration register.
|
|
@@ -531,6 +573,7 @@ class TcuInterface(DeviceInterface):
|
|
|
531
573
|
|
|
532
574
|
pass
|
|
533
575
|
|
|
576
|
+
@tsm_cmd()
|
|
534
577
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_tsm_adc_hpf_register)
|
|
535
578
|
def get_tsm_adc_hpf_register(self):
|
|
536
579
|
"""Returns the content of the high-pass corner frequency register.
|
|
@@ -541,10 +584,12 @@ class TcuInterface(DeviceInterface):
|
|
|
541
584
|
|
|
542
585
|
pass
|
|
543
586
|
|
|
587
|
+
@tsm_cmd()
|
|
544
588
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_tsm_adc_hpf_register)
|
|
545
589
|
def set_tsm_adc_hpf_register(self, cargo1: int = 0, cargo2: int = 0):
|
|
546
590
|
pass
|
|
547
591
|
|
|
592
|
+
@tsm_cmd()
|
|
548
593
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_tsm_adc_ofc_register)
|
|
549
594
|
def get_tsm_adc_ofc_register(self):
|
|
550
595
|
"""Returns the content of the offset calibration register.
|
|
@@ -555,10 +600,12 @@ class TcuInterface(DeviceInterface):
|
|
|
555
600
|
|
|
556
601
|
pass
|
|
557
602
|
|
|
603
|
+
@tsm_cmd()
|
|
558
604
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_tsm_adc_ofc_register)
|
|
559
605
|
def set_tsm_adc_ofc_register(self, cargo1: int = 0, cargo2: int = 0):
|
|
560
606
|
pass
|
|
561
607
|
|
|
608
|
+
@tsm_cmd()
|
|
562
609
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=get_tsm_adc_fsc_register)
|
|
563
610
|
def get_tsm_adc_fsc_register(self):
|
|
564
611
|
"""Returns the content of the full-scale calibration register.
|
|
@@ -569,22 +616,27 @@ class TcuInterface(DeviceInterface):
|
|
|
569
616
|
|
|
570
617
|
pass
|
|
571
618
|
|
|
619
|
+
@tsm_cmd()
|
|
572
620
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=set_tsm_adc_fsc_register)
|
|
573
621
|
def set_tsm_adc_fsc_register(self, cargo1: int = 0, cargo2: int = 0):
|
|
574
622
|
pass
|
|
575
623
|
|
|
624
|
+
@tsm_cmd()
|
|
576
625
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_command_latch)
|
|
577
626
|
def tsm_adc_command_latch(self, cargo1: int = 0, cargo2: int = 0):
|
|
578
627
|
pass
|
|
579
628
|
|
|
629
|
+
@tsm_cmd()
|
|
580
630
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_command)
|
|
581
631
|
def tsm_adc_command(self, cargo1: int = 0, cargo2: int = 0):
|
|
582
632
|
pass
|
|
583
633
|
|
|
634
|
+
@tsm_cmd()
|
|
584
635
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_calibration)
|
|
585
636
|
def tsm_adc_calibration(self, cargo1: int = 0, cargo2: int = 0):
|
|
586
637
|
pass
|
|
587
638
|
|
|
639
|
+
@tsm_cmd()
|
|
588
640
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_value_xx_currentn)
|
|
589
641
|
def tsm_adc_value_xx_currentn(self, probe: int = 1):
|
|
590
642
|
"""Returns the negative current to polarise the given thermistor.
|
|
@@ -598,6 +650,7 @@ class TcuInterface(DeviceInterface):
|
|
|
598
650
|
|
|
599
651
|
pass
|
|
600
652
|
|
|
653
|
+
@tsm_cmd()
|
|
601
654
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_value_xx_biasn)
|
|
602
655
|
def tsm_adc_value_xx_biasn(self, probe: int = 1):
|
|
603
656
|
"""Returns the voltage measured on the given thermistor biased with negative current.
|
|
@@ -611,6 +664,7 @@ class TcuInterface(DeviceInterface):
|
|
|
611
664
|
|
|
612
665
|
pass
|
|
613
666
|
|
|
667
|
+
@tsm_cmd()
|
|
614
668
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_value_xx_currentp)
|
|
615
669
|
def tsm_adc_value_xx_currentp(self, probe: int = 1):
|
|
616
670
|
"""Returns the positive current to polarise the given thermistor.
|
|
@@ -624,6 +678,7 @@ class TcuInterface(DeviceInterface):
|
|
|
624
678
|
|
|
625
679
|
pass
|
|
626
680
|
|
|
681
|
+
@tsm_cmd()
|
|
627
682
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_adc_value_xx_biasp)
|
|
628
683
|
def tsm_adc_value_xx_biasp(self, probe: int = 1):
|
|
629
684
|
"""Returns the voltage measured on the given thermistor biased with positive current.
|
|
@@ -637,6 +692,7 @@ class TcuInterface(DeviceInterface):
|
|
|
637
692
|
|
|
638
693
|
pass
|
|
639
694
|
|
|
695
|
+
@tsm_cmd()
|
|
640
696
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=tsm_acq_counter)
|
|
641
697
|
def tsm_acq_counter(self):
|
|
642
698
|
"""Reads the number of ADC measurement sequences that have been made.
|
|
@@ -649,6 +705,7 @@ class TcuInterface(DeviceInterface):
|
|
|
649
705
|
|
|
650
706
|
# HK commands
|
|
651
707
|
|
|
708
|
+
@hk_cmd()
|
|
652
709
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=vhk_psu_vmotor)
|
|
653
710
|
def vhk_psu_vmotor(self):
|
|
654
711
|
"""Returns the HK PSU motor voltage value.
|
|
@@ -659,6 +716,7 @@ class TcuInterface(DeviceInterface):
|
|
|
659
716
|
|
|
660
717
|
pass
|
|
661
718
|
|
|
719
|
+
@hk_cmd()
|
|
662
720
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=vhk_psu_vhi)
|
|
663
721
|
def vhk_psu_vhi(self):
|
|
664
722
|
"""Returns the HK PSU high voltage value.
|
|
@@ -669,6 +727,7 @@ class TcuInterface(DeviceInterface):
|
|
|
669
727
|
|
|
670
728
|
pass
|
|
671
729
|
|
|
730
|
+
@hk_cmd()
|
|
672
731
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=vhk_psu_vlow)
|
|
673
732
|
def vhk_psu_vlow(self):
|
|
674
733
|
"""Returns the HK PSU low voltage value.
|
|
@@ -679,6 +738,7 @@ class TcuInterface(DeviceInterface):
|
|
|
679
738
|
|
|
680
739
|
pass
|
|
681
740
|
|
|
741
|
+
@hk_cmd()
|
|
682
742
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=vhk_psu_vmedp)
|
|
683
743
|
def vhk_psu_vmedp(self):
|
|
684
744
|
"""Returns the HK PSU medium positive voltage value.
|
|
@@ -689,6 +749,7 @@ class TcuInterface(DeviceInterface):
|
|
|
689
749
|
|
|
690
750
|
pass
|
|
691
751
|
|
|
752
|
+
@hk_cmd()
|
|
692
753
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=vhk_psu_vmedn)
|
|
693
754
|
def vhk_psu_vmedn(self):
|
|
694
755
|
"""Returns the HK PSU medium negative voltage value.
|
|
@@ -699,6 +760,7 @@ class TcuInterface(DeviceInterface):
|
|
|
699
760
|
|
|
700
761
|
pass
|
|
701
762
|
|
|
763
|
+
@hk_cmd()
|
|
702
764
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=ihk_psu_vmedn)
|
|
703
765
|
def ihk_psu_vmedn(self):
|
|
704
766
|
"""Returns the HK PSU medium negative current value.
|
|
@@ -709,6 +771,7 @@ class TcuInterface(DeviceInterface):
|
|
|
709
771
|
|
|
710
772
|
pass
|
|
711
773
|
|
|
774
|
+
@hk_cmd()
|
|
712
775
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=ihk_psu_vmedp)
|
|
713
776
|
def ihk_psu_vmedp(self):
|
|
714
777
|
"""Returns the HK PSU medium positive current value.
|
|
@@ -719,6 +782,7 @@ class TcuInterface(DeviceInterface):
|
|
|
719
782
|
|
|
720
783
|
pass
|
|
721
784
|
|
|
785
|
+
@hk_cmd()
|
|
722
786
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=ihk_psu_vlow)
|
|
723
787
|
def ihk_psu_vlow(self):
|
|
724
788
|
"""Returns the HK PSU low current value.
|
|
@@ -729,6 +793,7 @@ class TcuInterface(DeviceInterface):
|
|
|
729
793
|
|
|
730
794
|
pass
|
|
731
795
|
|
|
796
|
+
@hk_cmd()
|
|
732
797
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=ihk_psu_vhi)
|
|
733
798
|
def ihk_psu_vhi(self):
|
|
734
799
|
"""Returns the HK PSU high current value.
|
|
@@ -749,6 +814,7 @@ class TcuInterface(DeviceInterface):
|
|
|
749
814
|
|
|
750
815
|
pass
|
|
751
816
|
|
|
817
|
+
@hk_cmd()
|
|
752
818
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_psu_first)
|
|
753
819
|
def thk_psu_first(self):
|
|
754
820
|
"""Returns the HK PSU temperature zone 1.
|
|
@@ -759,6 +825,7 @@ class TcuInterface(DeviceInterface):
|
|
|
759
825
|
|
|
760
826
|
pass
|
|
761
827
|
|
|
828
|
+
@hk_cmd()
|
|
762
829
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_m2md_first)
|
|
763
830
|
def thk_m2md_first(self):
|
|
764
831
|
"""Returns the HK M2MD temperature zone 1.
|
|
@@ -769,6 +836,7 @@ class TcuInterface(DeviceInterface):
|
|
|
769
836
|
|
|
770
837
|
pass
|
|
771
838
|
|
|
839
|
+
@hk_cmd()
|
|
772
840
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_psu_second)
|
|
773
841
|
def thk_psu_second(self):
|
|
774
842
|
"""Returns the HK M2MD temperature zone 2.
|
|
@@ -779,6 +847,7 @@ class TcuInterface(DeviceInterface):
|
|
|
779
847
|
|
|
780
848
|
pass
|
|
781
849
|
|
|
850
|
+
@hk_cmd()
|
|
782
851
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_m2md_second)
|
|
783
852
|
def thk_m2md_second(self):
|
|
784
853
|
"""Returns the HK M2MD temperature zone 2.
|
|
@@ -789,6 +858,7 @@ class TcuInterface(DeviceInterface):
|
|
|
789
858
|
|
|
790
859
|
pass
|
|
791
860
|
|
|
861
|
+
@hk_cmd()
|
|
792
862
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_cts_q1)
|
|
793
863
|
def thk_cts_q1(self):
|
|
794
864
|
"""Returns the HK CTS temperature first quarter.
|
|
@@ -799,6 +869,7 @@ class TcuInterface(DeviceInterface):
|
|
|
799
869
|
|
|
800
870
|
pass
|
|
801
871
|
|
|
872
|
+
@hk_cmd()
|
|
802
873
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_cts_q2)
|
|
803
874
|
def thk_cts_q2(self):
|
|
804
875
|
"""Returns the HK CTS temperature second quarter.
|
|
@@ -809,6 +880,7 @@ class TcuInterface(DeviceInterface):
|
|
|
809
880
|
|
|
810
881
|
pass
|
|
811
882
|
|
|
883
|
+
@hk_cmd()
|
|
812
884
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_cts_q3)
|
|
813
885
|
def thk_cts_q3(self):
|
|
814
886
|
"""Returns the HK CTS temperature third quarter.
|
|
@@ -819,6 +891,7 @@ class TcuInterface(DeviceInterface):
|
|
|
819
891
|
|
|
820
892
|
pass
|
|
821
893
|
|
|
894
|
+
@hk_cmd()
|
|
822
895
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_cts_q4)
|
|
823
896
|
def thk_cts_q4(self):
|
|
824
897
|
"""Returns the HK CTS temperature fourth quarter.
|
|
@@ -829,6 +902,7 @@ class TcuInterface(DeviceInterface):
|
|
|
829
902
|
|
|
830
903
|
pass
|
|
831
904
|
|
|
905
|
+
@hk_cmd()
|
|
832
906
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_cts_fpga)
|
|
833
907
|
def thk_cts_fpga(self):
|
|
834
908
|
"""Returns the HK CTS temperature FPGA.
|
|
@@ -839,6 +913,7 @@ class TcuInterface(DeviceInterface):
|
|
|
839
913
|
|
|
840
914
|
pass
|
|
841
915
|
|
|
916
|
+
@hk_cmd()
|
|
842
917
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=thk_cts_ads1282)
|
|
843
918
|
def thk_cts_ads1282(self):
|
|
844
919
|
"""Returns the HK CTS temperature ADS1282.
|
|
@@ -849,6 +924,7 @@ class TcuInterface(DeviceInterface):
|
|
|
849
924
|
|
|
850
925
|
pass
|
|
851
926
|
|
|
927
|
+
@hk_cmd()
|
|
852
928
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=vhk_ths_ret)
|
|
853
929
|
def vhk_ths_ret(self):
|
|
854
930
|
"""Returns the HK CTS thermistors return voltage.
|
|
@@ -859,6 +935,7 @@ class TcuInterface(DeviceInterface):
|
|
|
859
935
|
|
|
860
936
|
pass
|
|
861
937
|
|
|
938
|
+
@hk_cmd()
|
|
862
939
|
@dynamic_command(cmd_type=CommandType.TRANSACTION, cmd_string_func=hk_acq_counter)
|
|
863
940
|
def hk_acq_counter(self):
|
|
864
941
|
"""Returns the running counter that indicates the number of HK measurement sequences that have been made.
|
|
@@ -1104,15 +1181,30 @@ class TcuProxy(DynamicProxy, TcuInterface):
|
|
|
1104
1181
|
def __init__(self):
|
|
1105
1182
|
"""Initialisation of a TCUProxy."""
|
|
1106
1183
|
|
|
1107
|
-
|
|
1108
|
-
|
|
1184
|
+
# Fixed ports -> Use information from settings
|
|
1185
|
+
# This allows use to use the TCU CS without the core services
|
|
1186
|
+
|
|
1187
|
+
if COMMANDING_PORT != 0:
|
|
1188
|
+
super().__init__(connect_address(PROTOCOL, HOSTNAME, COMMANDING_PORT))
|
|
1189
|
+
|
|
1190
|
+
# Dynamic port allocation -> Use Registry Client
|
|
1109
1191
|
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
port = service["port"]
|
|
1192
|
+
else:
|
|
1193
|
+
with RegistryClient() as reg:
|
|
1194
|
+
service = reg.discover_service(SERVICE_TYPE)
|
|
1114
1195
|
|
|
1115
|
-
|
|
1196
|
+
if service:
|
|
1197
|
+
protocol = service.get("protocol", "tcp")
|
|
1198
|
+
hostname = service["host"]
|
|
1199
|
+
port = service["port"]
|
|
1116
1200
|
|
|
1117
|
-
|
|
1118
|
-
|
|
1201
|
+
super().__init__(connect_address(protocol, hostname, port), timeout=PROXY_TIMEOUT)
|
|
1202
|
+
|
|
1203
|
+
else:
|
|
1204
|
+
raise RuntimeError(f"No service registered as {SERVICE_TYPE}")
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
class TcuHex(TcuInterface, DynamicCommandMixin):
|
|
1208
|
+
def __init__(self):
|
|
1209
|
+
super().__init__()
|
|
1210
|
+
self.transport = self.tcu = TcuHexInterface()
|