6import daqconf.detreadoutmap
as dromap
8from crappyzcu.tx_endpoints
import tx_endpoints
9from crappyzcu.rx_endpoints
import rx_endpoints
11m = dromap.DetReadoutMapService()
13rx_host =
'np02-srv-002'
18rx_props = rx_endpoints[f
'{rx_host}-100G']
19rx_mac =
':'.join([f
"{s:02x}" for s
in rx_props[
'mac'].to_bytes(6,
'big')])
23rx = re.compile(
r"np04-wib-(\d)0(\d)-d(\d)")
26for name, tx_props
in tx_endpoints.items():
31 if int(c) != crate_id:
38 src_id = max(m.get())+1
if m.get()
else 0
41 tx_mac =
':'.join([f
"{s:02x}" for s
in tx_props[
'mac'].to_bytes(6,
'big')])
46 dromap.GeoID(det_id, c, s, strm_id),
63outpath = f
'apa{crate_id}_detreadout.json'
64with open(outpath,
"w")
as f:
65 json.dump(m.as_json(), f, indent=4)
66print(f
"Map saved to '{outpath}'")
69IPython.embed(colors=
"neutral")