From f268b6d8fef6b2722c97be75d92f7672902504c7 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Thu, 21 Dec 2023 03:35:19 +0000 Subject: [PATCH] Create more than one image per interval. --- docker/Dockerfile.base | 2 +- gamutrf/grsource.py | 10 +++++----- gamutrf/offline.py | 6 ++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 1e823567..df6a5971 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -28,7 +28,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libvulkan-dev \ python3-numpy WORKDIR /root -RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.58 +RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.59 COPY --from=iqtlabs/gamutrf-vkfft:latest /root /root/gr-iqtlabs WORKDIR /root/gr-iqtlabs/build COPY --from=sigmf-builder /usr/local /usr/local diff --git a/gamutrf/grsource.py b/gamutrf/grsource.py index 2596b7ac..db268ede 100644 --- a/gamutrf/grsource.py +++ b/gamutrf/grsource.py @@ -37,13 +37,13 @@ def airt_workaround_start_hook(self): self.sources[0].set_bandwidth(0, rate) -class file_source_tagger(gr.sync_block): +class file_source_tagger(gr.basic_block): def __init__( self, input_file, cmd_port, ): - gr.sync_block.__init__( + gr.basic_block.__init__( self, name="file_source_tagger", in_sig=None, @@ -71,9 +71,9 @@ def add_tags(self): pmt.from_double(self.center_freq), ) - def work(self, input_items, output_items): + def general_work(self, input_items, output_items): if self.complete(): - return 0 + return -1 if self.need_tags: self.add_tags() self.need_tags = False @@ -81,7 +81,7 @@ def work(self, input_items, output_items): samples = self.samples[self.i : self.i + n] if len(samples) < n: self.i = self.n_samples - return 0 + return -1 self.i += len(samples) output_items[0][:] = samples return len(samples) diff --git a/gamutrf/offline.py b/gamutrf/offline.py index 2592dd46..db1361c1 100644 --- a/gamutrf/offline.py +++ b/gamutrf/offline.py @@ -38,14 +38,12 @@ def main(): "iqtlabs": iqtlabs, "freq_end": 0, "freq_start": freq_start, - "pretune": True, "samp_rate": int(meta["sample_rate"]), "sdr": "file:" + filename, + "pretune": True, } ) tb = grscan(**scan_args) tb.start() - while not tb.sources[0].complete(): - time.sleep(1) - tb.stop() tb.wait() + tb.stop()