DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dump_buffer_command_gen.py
Go to the documentation of this file.
1from rich.console import Console
2console = Console()
3
4# Set moo schema search path
5from dunedaq.env import get_moo_model_path
6import moo.io
7moo.io.default_load_path = get_moo_model_path()
8
9# Load configuration types
10import moo.otypes
11moo.otypes.load_types("daphnemodules/DaphneV2ControllerModule.jsonnet")
12import dunedaq.daphnemodules.DaphneV2ControllerModule as DaphneV2ControllerModule
13
14from appfwk.utils import acmd
15
16import json
17import math
18
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
generate_daphne_rc_cmds(directory, n_samples, app_name, JSON_DIR, DEBUG=False)