diff options
Diffstat (limited to 'gr-pager/python')
-rw-r--r-- | gr-pager/python/pager/CMakeLists.txt | 49 | ||||
-rw-r--r-- | gr-pager/python/pager/__init__.py | 37 | ||||
-rw-r--r-- | gr-pager/python/pager/flex_demod.py | 66 | ||||
-rw-r--r-- | gr-pager/python/pager/pager_utils.py | 60 | ||||
-rwxr-xr-x | gr-pager/python/pager/qa_pager.py | 34 |
5 files changed, 0 insertions, 246 deletions
diff --git a/gr-pager/python/pager/CMakeLists.txt b/gr-pager/python/pager/CMakeLists.txt deleted file mode 100644 index 899c62e322..0000000000 --- a/gr-pager/python/pager/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2011-2012 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. - -######################################################################## -include(GrPython) - -GR_PYTHON_INSTALL( - FILES - __init__.py - pager_utils.py - flex_demod.py - DESTINATION ${GR_PYTHON_DIR}/gnuradio/pager - COMPONENT "pager_python" -) - -######################################################################## -# Handle the unit tests -######################################################################## -if(ENABLE_TESTING) - - set(GR_TEST_TARGET_DEPS "") - set(GR_TEST_LIBRARY_DIRS "") - set(GR_TEST_PYTHON_DIRS - ${CMAKE_BINARY_DIR}/gnuradio-runtime/python - ) - - include(GrTest) - file(GLOB py_qa_test_files "qa_*.py") - foreach(py_qa_test_file ${py_qa_test_files}) - get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) - GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file}) - endforeach(py_qa_test_file) -endif(ENABLE_TESTING) diff --git a/gr-pager/python/pager/__init__.py b/gr-pager/python/pager/__init__.py deleted file mode 100644 index ea4856fad6..0000000000 --- a/gr-pager/python/pager/__init__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright 2006 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. -# - -# The presence of this file turns this directory into a Python package - -''' -The GNU Radio pager application. -''' -import os - -try: - from pager_swig import * -except ImportError: - dirname, filename = os.path.split(os.path.abspath(__file__)) - __path__.append(os.path.join(dirname, "..", "..", "swig")) - from pager_swig import * - -from flex_demod import flex_demod -from pager_utils import * diff --git a/gr-pager/python/pager/flex_demod.py b/gr-pager/python/pager/flex_demod.py deleted file mode 100644 index 3ed469886c..0000000000 --- a/gr-pager/python/pager/flex_demod.py +++ /dev/null @@ -1,66 +0,0 @@ -# -# Copyright 2006,2007 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. -# - -from gnuradio import gr -from gnuradio import analog -from gnuradio import blocks -from gnuradio import filter -from math import pi -import pager_swig - -class flex_demod(gr.hier_block2): - """ - FLEX pager protocol demodulation block. - - This block demodulates a band-limited, complex down-converted baseband - channel into FLEX protocol frames. - - """ - - def __init__(self, queue, freq=0.0, verbose=False, log=False): - gr.hier_block2.__init__(self, "flex_demod", - gr.io_signature(1, 1, gr.sizeof_gr_complex), - gr.io_signature(0,0,0)) - - k = 25000/(2*pi*1600) # 4800 Hz max deviation - quad = analog.quadrature_demod_cf(k) - self.connect(self, quad) - - rsamp = filter.rational_resampler_fff(16, 25) - self.slicer = pager_swig.slicer_fb(5e-6) # DC removal averaging filter constant - self.sync = pager_swig.flex_sync() - - self.connect(quad, rsamp, self.slicer, self.sync) - - for i in range(4): - self.connect((self.sync, i), pager_swig.flex_deinterleave(), pager_swig.flex_parse(queue, freq)) - - if log: - suffix = '_'+ "%3.3f" % (freq/1e6,) + '.dat' - quad_sink = blocks.file_sink(gr.sizeof_float, 'quad'+suffix) - rsamp_sink = blocks.file_sink(gr.sizeof_float, 'rsamp'+suffix) - slicer_sink = blocks.file_sink(gr.sizeof_char, 'slicer'+suffix) - self.connect(rsamp, rsamp_sink) - self.connect(quad, quad_sink) - self.connect(self.slicer, slicer_sink) - - def dc_offset(self): - return self.slicer.dc_offset() diff --git a/gr-pager/python/pager/pager_utils.py b/gr-pager/python/pager/pager_utils.py deleted file mode 100644 index e935c86d4b..0000000000 --- a/gr-pager/python/pager/pager_utils.py +++ /dev/null @@ -1,60 +0,0 @@ -# -# Copyright 2008,2009 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 this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# - -from gnuradio import gr -import gnuradio.gr.gr_threading as _threading -from string import split, join, printable -import time - -def make_trans_table(): - table = 256 * ['.'] - for i in range(256): - if (i < 32): - table[i] = '.' - else: - table[i] = chr(i) - return ''.join(table) - -_trans_table = make_trans_table() - -def make_printable(s): - return s.translate(_trans_table) - - -class queue_runner(_threading.Thread): - def __init__(self, msgq): - _threading.Thread.__init__(self) - self.msgq = msgq - self.done = False - self.start() - - def run(self): - while 1: - msg = self.msgq.delete_head() # Blocking read - if msg.type() != 0: - break - - page = join(split(msg.to_string(), chr(128)), '|') - s = make_printable(page) - print msg.type(), s - - def end(self): - self.msgq.insert_tail(gr.message(1)) - self.done = True diff --git a/gr-pager/python/pager/qa_pager.py b/gr-pager/python/pager/qa_pager.py deleted file mode 100755 index dc9705e292..0000000000 --- a/gr-pager/python/pager/qa_pager.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2006,2010 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. -# - -from gnuradio import gr, gr_unittest, pager - -class test_pager(gr_unittest.TestCase): - - def setUp (self): - self.tb = gr.top_block () - - def tearDown (self): - self.tb = None - -if __name__ == '__main__': - gr_unittest.run(test_pager, "test_pager.xml") |