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

Functions

 irig (obj, device)
 
 status (ctx, obj)
 
 set_epoch (obj, epoch)
 
 set_epoch_value (obj, epoch_to_2000_seconds_tai, epoch_to_2000_leap_seconds)
 
 set_timebase (obj, timebase)
 
 set_seconds_offset (obj, offset)
 
 set_ticks_offset (obj, offset)
 

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

◆ set_epoch()

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

Definition at line 75 of file irig.py.

75def set_epoch(obj, epoch):
76
77 lDevice = obj.mDevice
78 lIRIG = obj.mIRIG
79
80 lEpoch=TimestampEpoch.__members__[epoch]
81 lIRIG.set_ts_epoch(lEpoch)
82# ------------------------------------------------------------------------------
83
84# ------------------------------------------------------------------------------
85@irig.command('set-epoch-value', short_help="Set ts epoch (custom mode)")
86@click.pass_obj
87@click.argument('epoch_to_2000_seconds_tai', type=int)
88@click.argument('epoch_to_2000_leap_seconds', type=int)

◆ set_epoch_value()

timing.cli.irig.set_epoch_value ( obj,
epoch_to_2000_seconds_tai,
epoch_to_2000_leap_seconds )

Definition at line 89 of file irig.py.

89def set_epoch_value(obj, epoch_to_2000_seconds_tai, epoch_to_2000_leap_seconds):
90
91 lDevice = obj.mDevice
92 lIRIG = obj.mIRIG
93
94 lIRIG.set_ts_epoch_value(epoch_to_2000_seconds_tai, epoch_to_2000_leap_seconds)
95# ------------------------------------------------------------------------------
96
97# ------------------------------------------------------------------------------
98@irig.command('set-timebase', short_help="Set ts timebase: TAI or UTC")
99@click.pass_obj
100@click.argument('timebase', type=click.Choice(TimestampTimebase.__members__.keys()))

◆ set_seconds_offset()

timing.cli.irig.set_seconds_offset ( obj,
offset )

Definition at line 114 of file irig.py.

114def set_seconds_offset(obj, offset):
115
116 lDevice = obj.mDevice
117 lIRIG = obj.mIRIG
118
119 lIRIG.set_ts_seconds_offset(offset)
120# ------------------------------------------------------------------------------
121
122# ------------------------------------------------------------------------------
123@irig.command('set-ticks-offset', short_help="Set ts ticks offset")
124@click.pass_obj
125@click.argument('offset', type=click.IntRange(-32768, 32767))

◆ set_ticks_offset()

timing.cli.irig.set_ticks_offset ( obj,
offset )

Definition at line 126 of file irig.py.

126def set_ticks_offset(obj, offset):
127
128 lDevice = obj.mDevice
129 lIRIG = obj.mIRIG
130
131 lIRIG.set_ts_ticks_offset(offset)
132# ------------------------------------------------------------------------------

◆ set_timebase()

timing.cli.irig.set_timebase ( obj,
timebase )

Definition at line 101 of file irig.py.

101def set_timebase(obj, timebase):
102
103 lDevice = obj.mDevice
104 lIRIG = obj.mIRIG
105
106 lTimebase=TimestampTimebase.__members__[timebase]
107 lIRIG.set_ts_timebase(lTimebase)
108# ------------------------------------------------------------------------------
109
110# ------------------------------------------------------------------------------
111@irig.command('set-seconds-offset', short_help="Set ts seconds offset")
112@click.pass_obj
113@click.argument('offset', type=click.IntRange(-128, 127))

◆ 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 ts epoch: UNIX or custom")
73@click.pass_obj
74@click.argument('epoch', type=click.Choice(TimestampEpoch.__members__.keys()))