From 81542f20ac8eab8223e82910d9d1b147ff02cb18 Mon Sep 17 00:00:00 2001 From: Michael Abbott Date: Wed, 20 Sep 2023 12:56:28 +0100 Subject: [PATCH] Rename SAMPLES to GATE_DURATION This addresses part of issues PandABlocks-server#8 and #152 --- modules/pcap/pcap.block.ini | 2 +- modules/pcap/pcap_sim.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/pcap/pcap.block.ini b/modules/pcap/pcap.block.ini index 54d137d34..dcd184cd0 100644 --- a/modules/pcap/pcap.block.ini +++ b/modules/pcap/pcap.block.ini @@ -43,7 +43,7 @@ description: Timestamp of last gate high +1 in current capture relative to enabl type: ext_out timestamp description: Timestamp of capture event relative to enable -[SAMPLES] +[GATE_DURATION] type: ext_out samples description: Number of gated samples in the current capture diff --git a/modules/pcap/pcap_sim.py b/modules/pcap/pcap_sim.py index 4270eb012..1c630a7e5 100644 --- a/modules/pcap/pcap_sim.py +++ b/modules/pcap/pcap_sim.py @@ -304,7 +304,7 @@ def on_capture(self, ts, gate): class PcapSimulation(BlockSimulation): ENABLE, GATE, TRIG, TRIG_EDGE, SHIFT_SUM, ACTIVE, TS_START_L, TS_START_H, \ - TS_END_L, TS_END_H, TS_TRIG_L, TS_TRIG_H, SAMPLES, \ + TS_END_L, TS_END_H, TS_TRIG_L, TS_TRIG_H, GATE_DURATION, \ BITS0, BITS1, BITS2, BITS3, HEALTH = PROPERTIES tick_data = True @@ -463,7 +463,7 @@ def add_capture_entry(self, data): entry.hi = True elif name.startswith("BITS"): entry = BitsCaptureEntry(i, int(name[-1])) - elif name == "SAMPLES": + elif name == "GATE_DURATION": entry = SampleCaptureEntry(i, self.SHIFT_SUM) else: raise ValueError("Bad name %s" % name)