From c1ddf6c43e36ddd3b347c152152af2fdc2f85f0d Mon Sep 17 00:00:00 2001 From: NichtJens Date: Fri, 10 Oct 2025 17:02:34 +0200 Subject: [PATCH] use parse_det_name --- tools/parammaps.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tools/parammaps.py b/tools/parammaps.py index 5d6f964..1b087ec 100755 --- a/tools/parammaps.py +++ b/tools/parammaps.py @@ -1,7 +1,9 @@ #!/usr/bin/env python from collections import defaultdict + from sf_daq_broker.detector.detector_config import DETECTOR_PORT, DETECTOR_UDP_SRCIP#, DETECTOR_UDP_SRCMAC +from sf_daq_broker.utils import parse_det_name def collect_data(d): @@ -12,8 +14,7 @@ def collect_data(d): res.update({i: [] for i in range(vmin, vmax + 1)}) for name, port in d.items(): - num = get_det_num(name) - ntiles = get_ntiles(name) + num, ntiles, _ = parse_det_name(name) for i in range(ntiles): entry = f"{num}:{i}" res[port + i].append(entry) @@ -21,14 +22,6 @@ def collect_data(d): return res -def get_det_num(name): - num = name[2:4] - return int(num) - -def get_ntiles(name): - num = name[5:7] - return int(num) - def print_table(d): for k, v in d.items(): # if not v: