summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgr-digital/examples/narrowband/digital_bert_rx.py2
-rw-r--r--gr-howto-write-a-block/python/CMakeLists.txt1
-rw-r--r--gr-howto-write-a-block/python/__init__.py1
-rw-r--r--gr-howto-write-a-block/python/qa_howto.py13
-rw-r--r--gr-howto-write-a-block/python/square3_ff.py47
-rw-r--r--gr-wxgui/src/python/forms/forms.py3
-rw-r--r--gr-wxgui/src/python/plotter/plotter_base.py2
-rw-r--r--grc/CMakeLists.txt8
-rw-r--r--grc/gui/FlowGraph.py5
-rw-r--r--volk/apps/CMakeLists.txt6
10 files changed, 77 insertions, 11 deletions
diff --git a/gr-digital/examples/narrowband/digital_bert_rx.py b/gr-digital/examples/narrowband/digital_bert_rx.py
index c044b25858..cc66456e93 100755
--- a/gr-digital/examples/narrowband/digital_bert_rx.py
+++ b/gr-digital/examples/narrowband/digital_bert_rx.py
@@ -116,7 +116,7 @@ class rx_psk_block(gr.top_block):
if(options.rx_freq is not None):
symbol_rate = options.bitrate / self._demodulator.bits_per_symbol()
- self._source = uhd_receiver(options.args, options.bitrate,
+ self._source = uhd_receiver(options.args, symbol_rate,
options.samples_per_symbol,
options.rx_freq, options.rx_gain,
options.spec,
diff --git a/gr-howto-write-a-block/python/CMakeLists.txt b/gr-howto-write-a-block/python/CMakeLists.txt
index d5fb195231..ac55316384 100644
--- a/gr-howto-write-a-block/python/CMakeLists.txt
+++ b/gr-howto-write-a-block/python/CMakeLists.txt
@@ -31,6 +31,7 @@ endif()
GR_PYTHON_INSTALL(
FILES
__init__.py
+ square3_ff.py
DESTINATION ${GR_PYTHON_DIR}/howto
)
diff --git a/gr-howto-write-a-block/python/__init__.py b/gr-howto-write-a-block/python/__init__.py
index 2bd27cb313..6e5e1c1475 100644
--- a/gr-howto-write-a-block/python/__init__.py
+++ b/gr-howto-write-a-block/python/__init__.py
@@ -25,6 +25,7 @@ description here (python/__init__.py).
# import swig generated symbols into the howto namespace
from howto_swig import *
+from square3_ff import square3_ff
# import any pure python here
#
diff --git a/gr-howto-write-a-block/python/qa_howto.py b/gr-howto-write-a-block/python/qa_howto.py
index b0f534987b..203b06922b 100644
--- a/gr-howto-write-a-block/python/qa_howto.py
+++ b/gr-howto-write-a-block/python/qa_howto.py
@@ -22,6 +22,7 @@
from gnuradio import gr, gr_unittest
import howto_swig as howto
+from square3_ff import square3_ff
class qa_howto(gr_unittest.TestCase):
@@ -55,5 +56,17 @@ class qa_howto(gr_unittest.TestCase):
result_data = dst.data()
self.assertFloatTuplesAlmostEqual(expected_result, result_data, 6)
+ def test_003_square3_ff (self):
+ src_data = (-3, 4, -5.5, 2, 3)
+ expected_result = (9, 16, 30.25, 4, 9)
+ src = gr.vector_source_f (src_data)
+ sqr = square3_ff ()
+ dst = gr.vector_sink_f ()
+ self.tb.connect (src, sqr)
+ self.tb.connect (sqr, dst)
+ self.tb.run ()
+ result_data = dst.data ()
+ self.assertFloatTuplesAlmostEqual (expected_result, result_data, 6)
+
if __name__ == '__main__':
gr_unittest.run(qa_howto, "qa_howto.xml")
diff --git a/gr-howto-write-a-block/python/square3_ff.py b/gr-howto-write-a-block/python/square3_ff.py
new file mode 100644
index 0000000000..df702734e5
--- /dev/null
+++ b/gr-howto-write-a-block/python/square3_ff.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+#
+# Copyright 2013 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.
+#
+
+import numpy
+from gnuradio import gr
+
+class square3_ff(gr.sync_block):
+ " Squaring block "
+ def __init__(self):
+ gr.sync_block.__init__(
+ self,
+ name = "square3_ff",
+ in_sig = [numpy.float32], # Input signature: 1 float at a time
+ out_sig = [numpy.float32], # Output signature: 1 float at a time
+ )
+
+ def work(self, input_items, output_items):
+ """ Notes:
+ - You must not forget the [:] at the output items, otherwise
+ stuff doesn't truly get copied to the output
+ - Both input_ and output_items[N] are numpy arrays, so you can
+ do fancy stuff like multiplying them elementwise
+ - noutput_items and ninput_items are implicit in the length of
+ output_items and input_items, respectively
+ """
+ output_items[0][:] = input_items[0] * input_items[0]
+ return len(output_items[0])
+
diff --git a/gr-wxgui/src/python/forms/forms.py b/gr-wxgui/src/python/forms/forms.py
index 6eee31585e..80822ae174 100644
--- a/gr-wxgui/src/python/forms/forms.py
+++ b/gr-wxgui/src/python/forms/forms.py
@@ -522,7 +522,8 @@ class notebook(_chooser_base):
self._add_widget(self._notebook)
def _handle(self, event): self[INT_KEY] = self._notebook.GetSelection()
- def _update(self, i): self._notebook.SetSelection(i)
+ # SetSelection triggers a page change event (deprecated, breaks on Windows) and ChangeSelection does not
+ def _update(self, i): self._notebook.ChangeSelection(i)
# ----------------------------------------------------------------
# Stand-alone test application
diff --git a/gr-wxgui/src/python/plotter/plotter_base.py b/gr-wxgui/src/python/plotter/plotter_base.py
index 7bea540d23..78e21f3c1d 100644
--- a/gr-wxgui/src/python/plotter/plotter_base.py
+++ b/gr-wxgui/src/python/plotter/plotter_base.py
@@ -157,6 +157,8 @@ class plotter_base(wx.glcanvas.GLCanvas, common.mutex):
Resize the view port if the width or height changed.
Redraw the screen, calling the draw functions.
"""
+ # create device context (needed on Windows, noop on X)
+ dc = wx.PaintDC(self)
self.lock()
self.SetCurrent()
diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt
index 219bbe1642..1156f1d760 100644
--- a/grc/CMakeLists.txt
+++ b/grc/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2011 Free Software Foundation, Inc.
+# Copyright 2011,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -100,13 +100,15 @@ file(TO_NATIVE_PATH ${GR_PYTHON_DIR} GR_PYTHON_POSTFIX)
string(REPLACE "\\" "\\\\" GR_PYTHON_POSTFIX ${GR_PYTHON_POSTFIX})
CPACK_SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
+ #!include \\\"winmessages.nsh\\\"
WriteRegStr HKLM ${HLKM_ENV} \\\"GRC_BLOCKS_PATH\\\" \\\"$INSTDIR\\\\${GRC_BLOCKS_PATH}\\\"
- WriteRegStr HKLM \\\"SOFTWARE\\\\Python\\\\PythonCore\\\\2.7\\\\PythonPath\\\" \\\"gnuradio\\\" \\\"$INSTDIR\\\\${GR_PYTHON_POSTFIX}\\\"
+ SendMessage \\\${HWND_BROADCAST} \\\${WM_WININICHANGE} 0 \\\"STR:Environment\\\" /TIMEOUT=5000
")
CPACK_SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
+ #!include \\\"winmessages.nsh\\\"
DeleteRegValue HKLM ${HLKM_ENV} \\\"GRC_BLOCKS_PATH\\\"
- DeleteRegValue HKLM \\\"SOFTWARE\\\\Python\\\\PythonCore\\\\2.7\\\\PythonPath\\\" \\\"gnuradio\\\"
+ SendMessage \\\${HWND_BROADCAST} \\\${WM_WININICHANGE} 0 \\\"STR:Environment\\\" /TIMEOUT=5000
")
endif(WIN32)
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index 8573e87b18..3f17c47bc8 100644
--- a/grc/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -534,8 +534,9 @@ class FlowGraph(Element):
Move a selected element to the new coordinate.
Auto-scroll the scroll bars at the boundaries.
"""
- #to perform a movement, the mouse must be pressed, no pending events
- if gtk.events_pending() or not self.mouse_pressed: return
+ #to perform a movement, the mouse must be pressed
+ # (no longer checking pending events via gtk.events_pending() - always true in Windows)
+ if not self.mouse_pressed: return
#perform autoscrolling
width, height = self.get_size()
x, y = coordinate
diff --git a/volk/apps/CMakeLists.txt b/volk/apps/CMakeLists.txt
index ee56b11c2a..577b7ef137 100644
--- a/volk/apps/CMakeLists.txt
+++ b/volk/apps/CMakeLists.txt
@@ -18,9 +18,7 @@
########################################################################
# Setup profiler
########################################################################
-find_package(Boost COMPONENTS unit_test_framework)
-
-if(Boost_FOUND AND UNIX) #uses mkdir and $HOME
+if(Boost_FOUND)
if(MSVC)
include_directories(${CMAKE_SOURCE_DIR}/msvc)
@@ -48,4 +46,4 @@ install(
COMPONENT "volk"
)
-endif(Boost_FOUND AND UNIX)
+endif(Boost_FOUND)