DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
tfc_gen.py
Go to the documentation of this file.
1# testapp_noreadout_two_process.py
2
3# This python configuration produces *two* json configuration files
4# that together form a MiniDAQApp with the same functionality as
5# MiniDAQApp v1, but in two processes. One process contains the
6# TriggerDecisionEmulator, while the other process contains everything
7# else.
8#
9# As with testapp_noreadout_confgen.py
10# in this directory, no modules from the readout package are used: the
11# fragments are provided by the FakeDataProdModule module from dfmodules
12
13import math
14from rich.console import Console
15console = Console()
16
17# Set moo schema search path
18from dunedaq.env import get_moo_model_path
19import moo.io
20moo.io.default_load_path = get_moo_model_path()
21
22# Load configuration types
23import moo.otypes
24moo.otypes.load_types('timinglibs/timingfanoutcontroller.jsonnet')
25import dunedaq.timinglibs.timingfanoutcontroller as tfc
26
27from daqconf.core.app import App, ModuleGraph
28from daqconf.core.daqmodule import DAQModule
29from daqconf.core.conf_utils import Direction
30
31#===============================================================================
32def get_tfc_app(FANOUT_DEVICE_NAME="",
33 FANOUT_CLOCK_FILE="",
34 FANOUT_CLOCK_SOURCE=1,
35 TIMING_SESSION="",
36 HARDWARE_STATE_RECOVERY_ENABLED=True,
37 HOST="localhost",
38 DEBUG=False):
39
40 modules = {}
41
42
43 modules = [DAQModule(name = "tfc",
44 plugin = "TimingFanoutController",
45 conf = tfc.ConfParams(
46 device=FANOUT_DEVICE_NAME,
47 hardware_state_recovery_enabled=HARDWARE_STATE_RECOVERY_ENABLED,
48 timing_session_name=TIMING_SESSION,
49 clock_config=FANOUT_CLOCK_FILE,
50 clock_source=FANOUT_CLOCK_SOURCE,
51 ))]
52
53 mgraph = ModuleGraph(modules)
54
55 mgraph.add_endpoint("timing_cmds", "tfc.timing_cmds", "TimingHwCmd", Direction.OUT)
56 mgraph.add_endpoint(FANOUT_DEVICE_NAME+"_info", "tfc."+FANOUT_DEVICE_NAME+"_info", "JSON", Direction.IN, is_pubsub=True)
57
58 tfc_app = App(modulegraph=mgraph, host=HOST, name="TFCApp")
59
60 if DEBUG:
61 tfc_app.export("tfc_app.dot")
62
63 return tfc_app
get_tfc_app(FANOUT_DEVICE_NAME="", FANOUT_CLOCK_FILE="", FANOUT_CLOCK_SOURCE=1, TIMING_SESSION="", HARDWARE_STATE_RECOVERY_ENABLED=True, HOST="localhost", DEBUG=False)
Definition tfc_gen.py:38