diff --git a/python/daqconf/detreadoutmap.py b/python/daqconf/detreadoutmap.py index 2b0f6b6a..c8cc410c 100644 --- a/python/daqconf/detreadoutmap.py +++ b/python/daqconf/detreadoutmap.py @@ -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']])) @@ -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 @@ -221,6 +223,7 @@ def _validate_rohosts(self, streams): host_label_map = { 'flx': 'host', 'eth': 'rx_host', + 'crt': 'host', } kind_m = defaultdict(set) @@ -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]): @@ -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 diff --git a/schema/daqconf/detreadoutmap.jsonnet b/schema/daqconf/detreadoutmap.jsonnet index 9cfe7e7e..b09a7517 100644 --- a/schema/daqconf/detreadoutmap.jsonnet +++ b/schema/daqconf/detreadoutmap.jsonnet @@ -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"]), @@ -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"),