Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update the crt dro to have an input directory option, and other fixes #443

Open
wants to merge 3 commits into
base: patch/fddaq-v4.4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions python/daqconf/detreadoutmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def group_by_key(coll, key):
dromap.DROStreamEntry,
dromap.EthStreamParameters,
dromap.FelixStreamParameters,
]:
dromap.CRTStreamParameters,
]:
c_ost = c.__dict__['_ost']
c_name = c_ost['name']
setattr(thismodule, c_name, namedtuple(c_name, [f['name'] for f in c_ost['fields']]))
Expand Down Expand Up @@ -95,6 +96,7 @@ class DetReadoutMapService:
_traits_map = {
'flx': StreamKindTraits(FelixStreamParameters, dromap.FelixStreamParameters, 'host', 'card'),
'eth': StreamKindTraits(EthStreamParameters, dromap.EthStreamParameters, 'rx_host', 'rx_iface'),
'crt': StreamKindTraits(CRTStreamParameters, dromap.CRTStreamParameters, 'host', 'usb'),
}

@classmethod
Expand Down Expand Up @@ -221,6 +223,7 @@ def _validate_rohosts(self, streams):
host_label_map = {
'flx': 'host',
'eth': 'rx_host',
'crt': 'host',
}

kind_m = defaultdict(set)
Expand Down Expand Up @@ -400,6 +403,8 @@ def as_table(self):
t.add_column(f"flx_{f}", style='cyan')
for f in EthStreamParameters._fields:
t.add_column(f"eth_{f}", style='magenta')
for f in CRTStreamParameters._fields:
t.add_column(f"crt_{f}", style='orange')

for s,en in sorted(m.items(), key=lambda x: x[0]):

Expand All @@ -414,7 +419,12 @@ def as_table(self):
infos = [str(x) for x in en.parameters]
pads = ['-']*(len(t.columns)-len(row)-len(infos))
row += pads + infos


elif en.kind == "crt":
infos = [str(x) for x in en.parameters]
pads = ['-']*(len(t.columns)-len(row)-len(infos))
row += pads + infos

t.add_row(*row)

return t
Expand Down
7 changes: 6 additions & 1 deletion schema/daqconf/detreadoutmap.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local cs = {
ipv4: s.string("ipv4", pattern=moo.re.ipv4, doc="ipv4 string"),
mac: s.string("mac", pattern="^[a-fA-F0-9]{2}(:[a-fA-F0-9]{2}){5}$", doc="mac string"),
pcie: s.string("pcie", pattern="^0{0,4}:[a-fA-F0-9]{2}:[a-fA-F0-9]{2}.[0-9]$", doc="pcie id string"),
kind: s.enum("StreamKind", ["eth", "flx"]),
kind: s.enum("StreamKind", ["eth", "flx", "crt"]),
mode: s.enum("StreamMode", ["fix_rate", "var_rate"]),
flx_protocol: s.enum("FlxProtocol", ["full", "half"]),
eth_protocol: s.enum("EthProtocol", ["udp", "zmq"]),
Expand All @@ -49,6 +49,11 @@ local cs = {
s.field("tx_ip", self.ipv4, "0.0.0.0", doc="Transmitter IP"),
], doc="A Ethernet readout stream configuration"),

crt_conf: s.record("CRTStreamParameters", [
s.field("host", self.host, doc="CRT hostname"),
s.field("usb", self.short, 0, doc="USB ID in readout host"),
s.field("data_directory", self.string, doc="location of raw CRTbinary data files")
], doc="A CRT readout stream configuration"),

stream_parameters: s.any("DROStreamConf", doc="Stream parameters"),

Expand Down