DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
daphnemodules
python
daphnemodules
dump_buffer_command_gen.py
Go to the documentation of this file.
1
from
rich.console
import
Console
2
console = Console()
3
4
# Set moo schema search path
5
from
dunedaq.env
import
get_moo_model_path
6
import
moo.io
7
moo.io.default_load_path = get_moo_model_path()
8
9
# Load configuration types
10
import
moo.otypes
11
moo.otypes.load_types(
"daphnemodules/DaphneV2ControllerModule.jsonnet"
)
12
import
dunedaq.daphnemodules.DaphneV2ControllerModule
as
DaphneV2ControllerModule
13
14
from
appfwk.utils
import
acmd
15
16
import
json
17
import
math
18
19
def
generate_daphne_rc_cmds
(
20
directory,
21
n_samples,
22
app_name,
23
JSON_DIR,
24
DEBUG=False,
25
):
26
27
cmds = [
28
(
"dump_buffers"
, acmd([ (
""
, DaphneV2ControllerModule.DumpBuffers(
29
directory=directory,
30
n_samples=n_samples))])),
31
]
32
33
data_dir = f
"{JSON_DIR}/data"
34
35
for
c,d
in
cmds:
36
cfg = {
"modules"
: [
37
{
"data"
: {
"directory"
: directory,
"n_samples"
: n_samples},
"match"
:
""
}]
38
}
39
with
open(f
"{data_dir}/{app_name}_{c}.json"
,
'w'
)
as
f:
40
json.dump(cfg, f, indent=4, sort_keys=
True
)
41
dump_buffer_command_gen.generate_daphne_rc_cmds
generate_daphne_rc_cmds(directory, n_samples, app_name, JSON_DIR, DEBUG=False)
Definition
dump_buffer_command_gen.py:25
dunedaq.env
Definition
env.py:1
Generated on
for DUNE-DAQ by
1.17.0