DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
timing.cli.irig Namespace Reference

Functions

 irig (obj, device)
 
 status (ctx, obj)
 
 synctime (obj, epoch)
 

Function Documentation

◆ irig()

timing.cli.irig.irig ( obj,
device )
IRIG commands.

\b
DEVICE: uhal device identifier
IDS: id(s) of the target endpoint(s).

Definition at line 22 of file irig.py.

22def irig(obj, device):
23 '''
24 IRIG commands.
25
26 \b
27 DEVICE: uhal device identifier
28 IDS: id(s) of the target endpoint(s).
29 '''
30
31 lDevice = obj.mConnectionManager.getDevice(str(device))
32 if obj.mTimeout:
33 lDevice.setTimeoutPeriod(obj.mTimeout)
34
35
36 echo('Created IRIG device')
37 lTopDesign = lDevice.getNode('')
38 lBoardInfo = toolbox.readSubNodes(lDevice.getNode('io.config'), False)
39 lDevice.dispatch()
40
41 if lBoardInfo['board_type'].value() in kLibrarySupportedBoards and lBoardInfo['design_type'].value() in kLibrarySupportedDesigns:
42 lTopDesign.validate_firmware_version()
43 try:
44 echo(lDevice.getNode('io').get_hardware_info())
45 except:
46 secho("Failed to retrieve hardware information! I2C issue? Initial board reset needed?", fg='yellow')
47 e = sys.exc_info()[0]
48 secho("Error: {}".format(e), fg='red')
49
50 obj.mDevice = lDevice
51 obj.mTopDesign = lDevice.getNode('')
52 obj.mIRIG = lDevice.getNode('irig_time_source')
53# ------------------------------------------------------------------------------
54
55
56# ------------------------------------------------------------------------------
57@irig.command('status')
58@click.pass_obj
59@click.pass_context

◆ status()

timing.cli.irig.status ( ctx,
obj )
Print the status of IRIG block.

Definition at line 60 of file irig.py.

60def status(ctx, obj):
61 '''
62 Print the status of IRIG block.
63 '''
64
65 lDevice = obj.mDevice
66 lIRIG = obj.mIRIG
67
68 echo(lIRIG.get_status())
69# ------------------------------------------------------------------------------
70
71# ------------------------------------------------------------------------------
72@irig.command('set-epoch', short_help="Set IRIG epoch: TAI or UNIX")
73@click.pass_obj
74@click.argument('epoch', type=click.Choice(IRIGEpoch.__members__.keys()))

◆ synctime()

timing.cli.irig.synctime ( obj,
epoch )

Definition at line 75 of file irig.py.

75def synctime(obj, epoch):
76
77 lDevice = obj.mDevice
78 lIRIG = obj.mIRIG
79
80 lEpoch=IRIGEpoch.__members__[epoch]
81 lIRIG.set_irig_epoch(lEpoch)
82# ------------------------------------------------------------------------------