From de8ba5b768c1c2d4b754e049275474ffc10990e6 Mon Sep 17 00:00:00 2001 From: Manolis Surligas Date: Tue, 24 Dec 2019 00:17:31 +0200 Subject: [PATCH] Automatically generate flowgraphs with GRCC This commit adds GRCC into the CMake build system and creates the executables from the .grc files on demand. Because there is always the case that the gr-satnogs has not been installed yet in the system, we still ship the auto-generated from our side executables. In next releases, during the install target, the GRCC and the executables generation, will be called after the gr-satnogs is installed. --- apps/CMakeLists.txt | 12 +---- apps/flowgraphs/CMakeLists.txt | 48 +++++++++++++++++++ apps/flowgraphs/satellites/CMakeLists.txt | 13 +++++ .../satnogs_amsat_fox_duv_decoder.py | 1 - .../satellites/satnogs_noaa_apt_decoder.py | 1 - ...ogs_reaktor_hello_world_fsk9600_decoder.py | 1 - apps/flowgraphs/satnogs_afsk1200_ax25.py | 1 - apps/flowgraphs/satnogs_bpsk_ax25.py | 1 - apps/flowgraphs/satnogs_cw_decoder.py | 1 - apps/flowgraphs/satnogs_example_flowgraph.py | 1 - apps/flowgraphs/satnogs_fsk_ax25.py | 1 - apps/flowgraphs/satnogs_iq_receiver.py | 1 - 12 files changed, 62 insertions(+), 20 deletions(-) create mode 100644 apps/flowgraphs/CMakeLists.txt diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 3b0959d..632530b 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -19,14 +19,4 @@ include(GrPython) -add_subdirectory(flowgraphs/satellites) - -GR_PYTHON_INSTALL( - PROGRAMS - flowgraphs/satnogs_cw_decoder.py - flowgraphs/satnogs_afsk1200_ax25.py - flowgraphs/satnogs_example_flowgraph.py - flowgraphs/satnogs_fsk_ax25.py - flowgraphs/satnogs_bpsk_ax25.py - DESTINATION bin -) +add_subdirectory(flowgraphs) diff --git a/apps/flowgraphs/CMakeLists.txt b/apps/flowgraphs/CMakeLists.txt new file mode 100644 index 0000000..55b509f --- /dev/null +++ b/apps/flowgraphs/CMakeLists.txt @@ -0,0 +1,48 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +add_subdirectory(satellites) + +set(flowgraphs + afsk1200_ax25.grc + bpsk_ax25.grc + cw_decoder.grc + example_flowgraph.grc + fsk_ax25.grc + iq_receiver.grc +) +message(“Compiling GRC SatNOGS flowgraphs…”) +foreach(grc_file ${flowgraphs}) + + message("Compiling " ${grc_file}) + execute_process(COMMAND grcc ${grc_file} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +endforeach() + +GR_PYTHON_INSTALL( + PROGRAMS + satnogs_afsk1200_ax25.py + satnogs_bpsk_ax25.py + satnogs_cw_decoder.py + satnogs_example_flowgraph.py + satnogs_fsk_ax25.py + satnogs_iq_receiver.py + DESTINATION bin +) \ No newline at end of file diff --git a/apps/flowgraphs/satellites/CMakeLists.txt b/apps/flowgraphs/satellites/CMakeLists.txt index 25e76e2..a9a87ff 100644 --- a/apps/flowgraphs/satellites/CMakeLists.txt +++ b/apps/flowgraphs/satellites/CMakeLists.txt @@ -19,6 +19,19 @@ include(GrPython) +set(flowgraphs + amsat_fox_duv_decoder.grc + noaa_apt_decoder.grc + reaktor_hello_world_fsk9600_decoder.grc +) +message(“Compiling GRC SatNOGS satellite specific flowgraphs…”) +foreach(grc_file ${flowgraphs}) + + message("Compiling " ${grc_file}) + execute_process(COMMAND grcc ${grc_file} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +endforeach() GR_PYTHON_INSTALL( PROGRAMS satnogs_amsat_fox_duv_decoder.py diff --git a/apps/flowgraphs/satellites/satnogs_amsat_fox_duv_decoder.py b/apps/flowgraphs/satellites/satnogs_amsat_fox_duv_decoder.py index e65f2db..e9ae1cf 100755 --- a/apps/flowgraphs/satellites/satnogs_amsat_fox_duv_decoder.py +++ b/apps/flowgraphs/satellites/satnogs_amsat_fox_duv_decoder.py @@ -284,7 +284,6 @@ class satnogs_amsat_fox_duv_decoder(gr.top_block): def set_iq_file_path(self, iq_file_path): self.iq_file_path = iq_file_path - self.satnogs_iq_sink_0.open(self.iq_file_path) def get_lo_offset(self): return self.lo_offset diff --git a/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py b/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py index 14be69b..68d1c31 100755 --- a/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py +++ b/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py @@ -286,7 +286,6 @@ class satnogs_noaa_apt_decoder(gr.top_block): def set_iq_file_path(self, iq_file_path): self.iq_file_path = iq_file_path - self.satnogs_iq_sink_0_0.open(self.iq_file_path) def get_lo_offset(self): return self.lo_offset diff --git a/apps/flowgraphs/satellites/satnogs_reaktor_hello_world_fsk9600_decoder.py b/apps/flowgraphs/satellites/satnogs_reaktor_hello_world_fsk9600_decoder.py index 62c0615..bf8fa00 100755 --- a/apps/flowgraphs/satellites/satnogs_reaktor_hello_world_fsk9600_decoder.py +++ b/apps/flowgraphs/satellites/satnogs_reaktor_hello_world_fsk9600_decoder.py @@ -308,7 +308,6 @@ class satnogs_reaktor_hello_world_fsk9600_decoder(gr.top_block): def set_iq_file_path(self, iq_file_path): self.iq_file_path = iq_file_path - self.satnogs_iq_sink_0.open(self.iq_file_path) def get_lo_offset(self): return self.lo_offset diff --git a/apps/flowgraphs/satnogs_afsk1200_ax25.py b/apps/flowgraphs/satnogs_afsk1200_ax25.py index 4cd99c5..516d707 100755 --- a/apps/flowgraphs/satnogs_afsk1200_ax25.py +++ b/apps/flowgraphs/satnogs_afsk1200_ax25.py @@ -331,7 +331,6 @@ class satnogs_afsk1200_ax25(gr.top_block): def set_iq_file_path(self, iq_file_path): self.iq_file_path = iq_file_path - self.satnogs_iq_sink_0.open(self.iq_file_path) def get_lo_offset(self): return self.lo_offset diff --git a/apps/flowgraphs/satnogs_bpsk_ax25.py b/apps/flowgraphs/satnogs_bpsk_ax25.py index 1950409..4c4b751 100755 --- a/apps/flowgraphs/satnogs_bpsk_ax25.py +++ b/apps/flowgraphs/satnogs_bpsk_ax25.py @@ -318,7 +318,6 @@ class satnogs_bpsk_ax25(gr.top_block): def set_iq_file_path(self, iq_file_path): self.iq_file_path = iq_file_path - self.satnogs_iq_sink_0_0.open(self.iq_file_path) def get_lo_offset(self): return self.lo_offset diff --git a/apps/flowgraphs/satnogs_cw_decoder.py b/apps/flowgraphs/satnogs_cw_decoder.py index 8f9f6aa..a653329 100755 --- a/apps/flowgraphs/satnogs_cw_decoder.py +++ b/apps/flowgraphs/satnogs_cw_decoder.py @@ -297,7 +297,6 @@ class satnogs_cw_decoder(gr.top_block): def set_iq_file_path(self, iq_file_path): self.iq_file_path = iq_file_path - self.satnogs_iq_sink_0.open(self.iq_file_path) def get_lo_offset(self): return self.lo_offset diff --git a/apps/flowgraphs/satnogs_example_flowgraph.py b/apps/flowgraphs/satnogs_example_flowgraph.py index fa30916..264dc4a 100755 --- a/apps/flowgraphs/satnogs_example_flowgraph.py +++ b/apps/flowgraphs/satnogs_example_flowgraph.py @@ -249,7 +249,6 @@ class satnogs_example_flowgraph(gr.top_block): def set_iq_file_path(self, iq_file_path): self.iq_file_path = iq_file_path - self.satnogs_iq_sink_0.open(self.iq_file_path) def get_lo_offset(self): return self.lo_offset diff --git a/apps/flowgraphs/satnogs_fsk_ax25.py b/apps/flowgraphs/satnogs_fsk_ax25.py index cbc8ac2..7042eb1 100755 --- a/apps/flowgraphs/satnogs_fsk_ax25.py +++ b/apps/flowgraphs/satnogs_fsk_ax25.py @@ -311,7 +311,6 @@ class satnogs_fsk_ax25(gr.top_block): def set_iq_file_path(self, iq_file_path): self.iq_file_path = iq_file_path - self.satnogs_iq_sink_0.open(self.iq_file_path) def get_lo_offset(self): return self.lo_offset diff --git a/apps/flowgraphs/satnogs_iq_receiver.py b/apps/flowgraphs/satnogs_iq_receiver.py index 5704375..3a558a0 100755 --- a/apps/flowgraphs/satnogs_iq_receiver.py +++ b/apps/flowgraphs/satnogs_iq_receiver.py @@ -223,7 +223,6 @@ class satnogs_iq_receiver(gr.top_block): def set_iq_file_path(self, iq_file_path): self.iq_file_path = iq_file_path - self.satnogs_iq_sink_0.open(self.iq_file_path) def get_lo_offset(self): return self.lo_offset