summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.guess12
-rw-r--r--config.sub13
-rw-r--r--config/ax_boost_base.m410
-rw-r--r--config/ax_boost_python.m48
-rw-r--r--config/ax_boost_thread.m412
-rw-r--r--config/gr_check_createfilemapping.m411
-rw-r--r--config/gr_lib64.m42
-rw-r--r--config/gr_qwt.m44
-rw-r--r--configure.ac3
-rw-r--r--gnuradio-core/src/lib/Makefile.am4
-rw-r--r--gnuradio-core/src/lib/general/Makefile.am3
-rw-r--r--gnuradio-core/src/lib/general/general.i2
-rw-r--r--gnuradio-core/src/lib/general/gr_transcendental.cc153
-rw-r--r--gnuradio-core/src/lib/general/gr_transcendental.h48
-rw-r--r--gnuradio-core/src/lib/general/gr_transcendental.i33
-rw-r--r--gr-audio/examples/c++/Makefile.am4
-rwxr-xr-xgr-howto-write-a-block/config.guess370
-rwxr-xr-xgr-howto-write-a-block/config.sub196
-rw-r--r--gr-qtgui/lib/ConstellationDisplayPlot.cc39
-rw-r--r--gr-qtgui/lib/ConstellationDisplayPlot.h9
-rw-r--r--gr-qtgui/lib/FrequencyDisplayPlot.cc69
-rw-r--r--gr-qtgui/lib/FrequencyDisplayPlot.h9
-rw-r--r--gr-qtgui/lib/Makefile.am2
-rw-r--r--gr-qtgui/lib/TimeDomainDisplayPlot.cc42
-rw-r--r--gr-qtgui/lib/TimeDomainDisplayPlot.h8
-rw-r--r--gr-qtgui/lib/WaterfallDisplayPlot.cc183
-rw-r--r--gr-qtgui/lib/WaterfallDisplayPlot.h25
-rw-r--r--gr-qtgui/lib/plot_waterfall.cc139
-rw-r--r--gr-qtgui/lib/plot_waterfall.h31
-rw-r--r--gr-qtgui/lib/qtgui_sink_f.h1
-rw-r--r--gr-qtgui/lib/qtgui_util.cc34
-rw-r--r--gr-qtgui/lib/qtgui_util.h9
-rw-r--r--gr-qtgui/lib/spectrumdisplayform.cc22
-rw-r--r--gr-qtgui/lib/waterfallGlobalData.cc76
-rw-r--r--gr-qtgui/lib/waterfallGlobalData.h12
-rw-r--r--gr-usrp/apps/Makefile.am3
-rw-r--r--gr-wxgui/grc/wxgui_fftsink2.xml4
-rw-r--r--gr-wxgui/grc/wxgui_waterfallsink2.xml2
-rw-r--r--grc/blocks/Makefile.am1
-rw-r--r--grc/blocks/block_tree.xml2
-rw-r--r--grc/blocks/gr_complex_to_float.xml4
-rw-r--r--grc/blocks/gr_float_to_complex.xml4
-rw-r--r--grc/blocks/gr_transcendental.xml41
-rw-r--r--grc/python/Block.py14
-rw-r--r--grc/python/Connection.py15
-rw-r--r--grc/python/Constants.py34
-rw-r--r--grc/python/Platform.py15
-rw-r--r--grc/python/Port.py30
-rw-r--r--volk/config/ax_boost_base.m410
49 files changed, 1280 insertions, 497 deletions
diff --git a/config.guess b/config.guess
index b02565c7b..43f0cdbcf 100644
--- a/config.guess
+++ b/config.guess
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011 Free Software Foundation, Inc.
-timestamp='2011-06-03'
+timestamp='2011-10-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -792,13 +792,12 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
@@ -903,6 +902,9 @@ EOF
frv:Linux:*:*)
echo frv-unknown-linux-gnu
exit ;;
+ hexagon:Linux:*:*)
+ echo hexagon-unknown-linux-gnu
+ exit ;;
i*86:Linux:*:*)
LIBC=gnu
eval $set_cc_for_build
diff --git a/config.sub b/config.sub
index f9fcdc879..5b8736823 100644
--- a/config.sub
+++ b/config.sub
@@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011 Free Software Foundation, Inc.
-timestamp='2011-06-03'
+timestamp='2011-10-08'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -251,13 +251,17 @@ case $basic_machine in
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
+ | epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \
@@ -357,6 +361,7 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
@@ -365,8 +370,10 @@ case $basic_machine in
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@@ -813,6 +820,10 @@ case $basic_machine in
basic_machine=i370-ibm
os=-mvs
;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
diff --git a/config/ax_boost_base.m4 b/config/ax_boost_base.m4
index e9790227e..f2a7f6e83 100644
--- a/config/ax_boost_base.m4
+++ b/config/ax_boost_base.m4
@@ -276,7 +276,7 @@ AC_DEFUN([_AX_BOOST_CHECK_LIB_],[
dnl $1 is unit name. E.g., boost_thread
AC_DEFUN([_AX_BOOST_WITH],[
- _AX_BOOST_WITH_($1,m4_bpatsubst($1,_,-))
+ _AX_BOOST_WITH_([$1], [m4_bpatsubst($1,_,-)])
])
dnl $1 is unit name. E.g., boost_thread
@@ -305,7 +305,7 @@ dnl $2 is AC_LANG_PROGRAM argument 1
dnl $3 is AC_LANG_PROGRAM argument 2
dnl $4 is cv variable name. E.g., ax_cv_boost_thread
AC_DEFUN([_AX_BOOST_CHECK_],[
- _AX_BOOST_WITH($1)
+ _AX_BOOST_WITH([$1])
if test "$want_boost" = "yes"; then
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_CXX])
@@ -315,9 +315,9 @@ AC_DEFUN([_AX_BOOST_CHECK_],[
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
AC_CACHE_CHECK([whether the boost::m4_substr([$1],6) includes are available], [$4],
[AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([$2],[$3]),[$4]=yes,[$4]=no)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$2],[$3])], [[$4]=yes], [[$4]=no])
AC_LANG_POP([C++])
- ])
+ ])
if test "$[$4]" = "yes"; then
_AX_BOOST_CHECK_LIB([$1])
fi
@@ -330,5 +330,5 @@ dnl $1 is unit name. E.g., boost_thread
dnl $2 is AC_LANG_PROGRAM argument 1
dnl $3 is AC_LANG_PROGRAM argument 2
AC_DEFUN([_AX_BOOST_CHECK],[
- _AX_BOOST_CHECK_($1,$2,$3,ax_cv_$1)
+ _AX_BOOST_CHECK_([$1], [$2], [$3], [ax_cv_$1])
])
diff --git a/config/ax_boost_python.m4 b/config/ax_boost_python.m4
index 3c6c666f7..59c86ad0e 100644
--- a/config/ax_boost_python.m4
+++ b/config/ax_boost_python.m4
@@ -65,14 +65,14 @@ ac_cv_boost_python,
if test x$PYTHON_INCLUDE_DIR != x; then
CPPFLAGS=-I$PYTHON_INCLUDE_DIR $CPPFLAGS
fi
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <boost/python/module.hpp>
using namespace boost::python;
BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; }]],
- [[return 0;]]),
- ac_cv_boost_python=yes, ac_cv_boost_python=no)
+ [[return 0;]])],
+ [ac_cv_boost_python=yes, ac_cv_boost_python=no)
AC_LANG_RESTORE
- CPPFLAGS=$CPPFLAGS_SAVE
+ CPPFLAGS=$CPPFLAGS_SAVE]
])
if test "$ac_cv_boost_python" = "yes"; then
AC_LANG_PUSH([C++])
diff --git a/config/ax_boost_thread.m4 b/config/ax_boost_thread.m4
index 4df23224a..8e42510ea 100644
--- a/config/ax_boost_thread.m4
+++ b/config/ax_boost_thread.m4
@@ -46,19 +46,19 @@ AC_DEFUN([AX_BOOST_THREAD],
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS $PTHREAD_LIBS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
- AC_CACHE_CHECK(whether the boost::thread includes are available,
- ax_cv_boost_thread,
+ AC_CACHE_CHECK([whether the boost::thread includes are available],
+ [ax_cv_boost_thread],
[AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],
[[boost::thread_group thrds;
- return 0;]]),
- ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
+ return 0;]])],
+ [ax_cv_boost_thread=yes], [ax_cv_boost_thread=no])
AC_LANG_POP([C++])
])
if test "$ax_cv_boost_thread" = "yes"; then
BOOST_CXXFLAGS="$PTHREAD_CFLAGS"
- AC_SUBST(BOOST_CXXFLAGS)
+ AC_SUBST([BOOST_CXXFLAGS])
_AX_BOOST_CHECK_LIB([boost_thread])
if test "$link_ok" = "yes" && test -n "$PTHREAD_LIBS"; then
BOOST_THREAD_LIB="$BOOST_THREAD_LIB $PTHREAD_LIBS"
diff --git a/config/gr_check_createfilemapping.m4 b/config/gr_check_createfilemapping.m4
index 5f9b4a49a..a7e290dd3 100644
--- a/config/gr_check_createfilemapping.m4
+++ b/config/gr_check_createfilemapping.m4
@@ -25,7 +25,7 @@ dnl ])
AC_DEFUN([GR_CHECK_CREATEFILEMAPPING],[
AC_MSG_CHECKING([for CreateFileMapping function])
- AC_COMPILE_IFELSE([
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <windows.h>
int main (int argc, char **argv)
{
@@ -41,12 +41,13 @@ int main (int argc, char **argv)
seg_name); // name of mapping object
return 0;
}
-],[HAVE_CREATEFILEMAPPING=yes
- AC_DEFINE(HAVE_CREATEFILEMAPPING,[1],[Define if you have the CreateFilemapping function(win32).])],
+])],[HAVE_CREATEFILEMAPPING=yes
+ AC_DEFINE([HAVE_CREATEFILEMAPPING],[1],
+ [Define if you have the CreateFilemapping function(win32).])],
[HAVE_CREATEFILEMAPPING=no])
- AC_MSG_RESULT($HAVE_CREATEFILEMAPPING)
- AM_CONDITIONAL(HAVE_CREATEFILEMAPPING, test x$HAVE_CREATEFILEMAPPING = xyes)
+ AC_MSG_RESULT([$HAVE_CREATEFILEMAPPING])
+ AM_CONDITIONAL([HAVE_CREATEFILEMAPPING], [test x$HAVE_CREATEFILEMAPPING = xyes])
])
diff --git a/config/gr_lib64.m4 b/config/gr_lib64.m4
index 751f774b4..92f1bd917 100644
--- a/config/gr_lib64.m4
+++ b/config/gr_lib64.m4
@@ -40,7 +40,7 @@ AC_DEFUN([GR_LIB64],[
AC_MSG_CHECKING([gr_libdir_suffix])
gr_libdir_suffix=""
- AC_SUBST(gr_libdir_suffix)
+ AC_SUBST([gr_libdir_suffix])
case "$host_os" in
linux*) is_linux=yes ;;
diff --git a/config/gr_qwt.m4 b/config/gr_qwt.m4
index 537348ac6..035e94091 100644
--- a/config/gr_qwt.m4
+++ b/config/gr_qwt.m4
@@ -61,7 +61,7 @@ AC_DEFUN([GR_QWT],
if test "$qwt_incdir" = "" ; then
dnl check qwt-qt4/qwt.h (as in Ubuntu)
AC_CHECK_HEADER(
- [qwt-qt4/qwt_double_interval.h],
+ [qwt-qt4/qwt_math.h],
[qwt_qt4_qwt_h=yes],
[qwt_qt4_qwt_h=no]
)
@@ -71,7 +71,7 @@ AC_DEFUN([GR_QWT],
else
dnl check qwt/qwt.h (as in Fedora)
AC_CHECK_HEADER(
- [qwt/qwt_double_interval.h],
+ [qwt/qwt_math.h],
[qwt_qwt_h=yes],
[qwt_qwt_h=no]
)
diff --git a/configure.ac b/configure.ac
index c1a24a9ca..ca95005a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,7 +55,6 @@ LF_CONFIGURE_CC
LF_CONFIGURE_CXX
GR_LIB64 dnl check for lib64 suffix after choosing compilers
-
dnl The three macros above are known to override CFLAGS if the user
dnl didn't specify them. Though I'm sure somebody thought this was
dnl a good idea, it makes it hard to use other than -g -O2 when compiling
@@ -67,7 +66,7 @@ if test "$user_set_cflags" != yes; then
autoconf_default_CFLAGS="$CFLAGS"
CFLAGS=""
fi
-AC_SUBST(autoconf_default_CFLAGS)
+AC_SUBST([autoconf_default_CFLAGS])
dnl The three macros above are known to override CXXFLAGS if the user
diff --git a/gnuradio-core/src/lib/Makefile.am b/gnuradio-core/src/lib/Makefile.am
index 4db2ff167..db2482479 100644
--- a/gnuradio-core/src/lib/Makefile.am
+++ b/gnuradio-core/src/lib/Makefile.am
@@ -1,4 +1,3 @@
-#
# Copyright 2001,2004,2009,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
@@ -55,7 +54,8 @@ libgnuradio_core_la_LIBADD = \
$(GRUEL_LA) \
$(FFTW3F_LIBS) \
$(GSL_LIBS) \
- $(CBLAS_LIBS)
+ $(CBLAS_LIBS) \
+ $(BOOST_FILESYSTEM_LIB)
libgnuradio_core_qa_la_LIBADD = \
filter/libfilter-qa.la \
diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am
index 15272dd5c..007bedc00 100644
--- a/gnuradio-core/src/lib/general/Makefile.am
+++ b/gnuradio-core/src/lib/general/Makefile.am
@@ -156,6 +156,7 @@ libgeneral_la_SOURCES = \
gr_test.cc \
gr_threshold_ff.cc \
gr_throttle.cc \
+ gr_transcendental.cc \
gr_uchar_to_float.cc \
gr_vco_f.cc \
gr_vector_to_stream.cc \
@@ -322,6 +323,7 @@ grinclude_HEADERS = \
gr_test.h \
gr_threshold_ff.h \
gr_throttle.h \
+ gr_transcendental.h \
gr_uchar_to_float.h \
gr_vco.h \
gr_vco_f.h \
@@ -484,6 +486,7 @@ swiginclude_HEADERS = \
gr_test.i \
gr_threshold_ff.i \
gr_throttle.i \
+ gr_transcendental.i \
gr_uchar_to_float.i \
gr_vco_f.i \
gr_vector_to_stream.i \
diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i
index fd158cd1f..beedeb0a9 100644
--- a/gnuradio-core/src/lib/general/general.i
+++ b/gnuradio-core/src/lib/general/general.i
@@ -69,6 +69,7 @@
#include <gr_nlog10_ff.h>
#include <gr_fake_channel_coder_pp.h>
#include <gr_throttle.h>
+#include <gr_transcendental.h>
#include <gr_mpsk_receiver_cc.h>
#include <gr_stream_mux.h>
#include <gr_stream_to_streams.h>
@@ -196,6 +197,7 @@
%include "gr_nlog10_ff.i"
%include "gr_fake_channel_coder_pp.i"
%include "gr_throttle.i"
+%include "gr_transcendental.i"
%include "gr_mpsk_receiver_cc.i"
%include "gr_stream_mux.i"
%include "gr_stream_to_streams.i"
diff --git a/gnuradio-core/src/lib/general/gr_transcendental.cc b/gnuradio-core/src/lib/general/gr_transcendental.cc
new file mode 100644
index 000000000..46dc0055b
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_transcendental.cc
@@ -0,0 +1,153 @@
+/*
+ * 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.
+ */
+
+#include <gr_transcendental.h>
+#include <gr_io_signature.h>
+#include <stdexcept>
+#include <complex> //complex math
+#include <cmath> //real math
+#include <map>
+
+/***********************************************************************
+ * work function creation and registration
+ **********************************************************************/
+typedef int(*work_fcn_type)(int, gr_vector_const_void_star &, gr_vector_void_star &);
+struct map_val_type{
+ work_fcn_type work_fcn;
+ size_t io_size;
+};
+typedef std::map<std::string, map_val_type> map_type;
+
+//construct map on first use idiom
+static map_type &get_map(void){
+ static map_type map;
+ return map;
+}
+
+//static initialization of this object registers a function
+struct gr_transcendental_registrant{
+ gr_transcendental_registrant(
+ const std::string &key,
+ const work_fcn_type &work_fcn,
+ const size_t io_size
+ ){
+ map_val_type val;
+ val.work_fcn = work_fcn;
+ val.io_size = io_size;
+ get_map()[key] = val;
+ }
+};
+
+//macro to create a work function and register it
+#define REGISTER_FUNCTION(__fcn__, __type__, __key__) \
+ static int __key__ ## _work( \
+ int noutput_items, \
+ gr_vector_const_void_star &input_items, \
+ gr_vector_void_star &output_items \
+ ){ \
+ const __type__ *in = (const __type__ *) input_items[0]; \
+ __type__ *out = (__type__ *) output_items[0]; \
+ for (size_t i = 0; i < size_t(noutput_items); i++){ \
+ out[i] = std::__fcn__(in[i]); \
+ } \
+ return noutput_items; \
+ } \
+ gr_transcendental_registrant __key__ ## _registrant(#__key__, &__key__ ## _work, sizeof(__type__));
+
+//register work functions for real types
+#define REGISTER_REAL_FUNCTIONS(__fcn__) \
+ REGISTER_FUNCTION(__fcn__, float, __fcn__ ## _float) \
+ REGISTER_FUNCTION(__fcn__, double, __fcn__ ## _double)
+
+//register work functions for complex types
+#define REGISTER_COMPLEX_FUNCTIONS(__fcn__) \
+ REGISTER_FUNCTION(__fcn__, std::complex<float>, __fcn__ ## _complex_float) \
+ REGISTER_FUNCTION(__fcn__, std::complex<double>, __fcn__ ## _complex_double)
+
+//register both complex and real
+#define REGISTER_FUNCTIONS(__fcn__) \
+ REGISTER_REAL_FUNCTIONS(__fcn__) \
+ REGISTER_COMPLEX_FUNCTIONS(__fcn__)
+
+//create and register transcendental work functions
+REGISTER_FUNCTIONS(cos)
+REGISTER_FUNCTIONS(sin)
+REGISTER_FUNCTIONS(tan)
+REGISTER_REAL_FUNCTIONS(acos)
+REGISTER_REAL_FUNCTIONS(asin)
+REGISTER_REAL_FUNCTIONS(atan)
+REGISTER_FUNCTIONS(cosh)
+REGISTER_FUNCTIONS(sinh)
+REGISTER_FUNCTIONS(tanh)
+REGISTER_FUNCTIONS(exp)
+REGISTER_FUNCTIONS(log)
+REGISTER_FUNCTIONS(log10)
+REGISTER_FUNCTIONS(sqrt)
+
+/***********************************************************************
+ * implementation block simply calls into the function pointer
+ **********************************************************************/
+class gr_transcendental_impl : public gr_transcendental{
+public:
+ gr_transcendental_impl(
+ const work_fcn_type &work_fcn, const size_t io_size
+ ):
+ gr_sync_block(
+ "transcendental",
+ gr_make_io_signature(1, 1, io_size),
+ gr_make_io_signature(1, 1, io_size)
+ ),
+ _work_fcn(work_fcn)
+ {
+ // NOP
+ }
+
+ int work(
+ int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items
+ ){
+ return _work_fcn(noutput_items, input_items, output_items);
+ }
+
+private:
+ const work_fcn_type &_work_fcn;
+};
+
+/***********************************************************************
+ * factory function to make transcendental block
+ **********************************************************************/
+gr_transcendental::sptr gr_make_transcendental(
+ const std::string &name,
+ const std::string &type
+){
+ //search for an entry in the map
+ const std::string key = name + "_" + type;
+ const bool has_key = get_map().count(key) != 0;
+ if (!has_key) throw std::runtime_error(
+ "could not find transcendental function for " + key
+ );
+
+ //make a new block with found work function
+ return gr_transcendental::sptr(new gr_transcendental_impl(
+ get_map()[key].work_fcn, get_map()[key].io_size
+ ));
+}
diff --git a/gnuradio-core/src/lib/general/gr_transcendental.h b/gnuradio-core/src/lib/general/gr_transcendental.h
new file mode 100644
index 000000000..1b237c44a
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_transcendental.h
@@ -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.
+ */
+
+#ifndef INCLUDED_GR_TRANSCENDENTAL_H
+#define INCLUDED_GR_TRANSCENDENTAL_H
+
+#include <gr_sync_block.h>
+#include <string>
+
+/*!
+ * \brief A block that performs various transcendental math operations.
+ *
+ * Possible function names can be found in the cmath library.
+ * IO may be either complex or real, double or single precision.
+ *
+ * Possible type strings: float, double, complex_float, complex_double
+ *
+ * output[i] = trans_fcn(input[i])
+ */
+class gr_transcendental : virtual public gr_sync_block{
+public:
+ typedef boost::shared_ptr<gr_transcendental> sptr;
+};
+
+gr_transcendental::sptr gr_make_transcendental(
+ const std::string &name,
+ const std::string &type = "float"
+);
+
+#endif /* INCLUDED_GR_TRANSCENDENTAL_H */
diff --git a/gnuradio-core/src/lib/general/gr_transcendental.i b/gnuradio-core/src/lib/general/gr_transcendental.i
new file mode 100644
index 000000000..1eea73f40
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_transcendental.i
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+////////////////////////////////////////////////////////////////////////
+// block headers
+////////////////////////////////////////////////////////////////////////
+%{
+#include <gr_transcendental.h>
+%}
+
+////////////////////////////////////////////////////////////////////////
+// block magic
+////////////////////////////////////////////////////////////////////////
+GR_SWIG_BLOCK_MAGIC(gr,transcendental)
+%include <gr_transcendental.h>
diff --git a/gr-audio/examples/c++/Makefile.am b/gr-audio/examples/c++/Makefile.am
index 88bd7c1fd..d3283354f 100644
--- a/gr-audio/examples/c++/Makefile.am
+++ b/gr-audio/examples/c++/Makefile.am
@@ -35,4 +35,6 @@ GR_AUDIO_LA=$(top_builddir)/gr-audio/lib/libgnuradio-audio.la
noinst_PROGRAMS = dial_tone
dial_tone_SOURCES = dial_tone.cc
-dial_tone_LDADD = $(GNURADIO_CORE_LA) $(GR_AUDIO_LA)
+dial_tone_LDADD = \
+ $(GNURADIO_CORE_LA) $(GR_AUDIO_LA) \
+ $(BOOST_FILESYSTEM_LIB)
diff --git a/gr-howto-write-a-block/config.guess b/gr-howto-write-a-block/config.guess
index e3a2116a7..43f0cdbcf 100755
--- a/gr-howto-write-a-block/config.guess
+++ b/gr-howto-write-a-block/config.guess
@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
-timestamp='2009-06-10'
+timestamp='2011-10-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -27,16 +27,16 @@ timestamp='2009-06-10'
# the same distribution terms that you use for the rest of that program.
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -56,8 +56,9 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -180,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi
;;
*)
- os=netbsd
+ os=netbsd
;;
esac
# The OS release
@@ -223,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -269,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@@ -295,7 +299,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
+ echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
@@ -333,6 +337,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
@@ -391,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
@@ -477,8 +484,8 @@ EOF
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -491,7 +498,7 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@@ -548,7 +555,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[456])
+ *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -591,52 +598,52 @@ EOF
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
+ esac ;;
+ esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >$dummy.c
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -727,22 +734,22 @@ EOF
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
@@ -766,14 +773,14 @@ EOF
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -785,13 +792,12 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
@@ -801,18 +807,18 @@ EOF
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
- *:Interix*:[3456]*)
- case ${UNAME_MACHINE} in
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
- EM64T | authenticamd | genuineintel)
+ authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
@@ -854,6 +860,20 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -861,7 +881,13 @@ EOF
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ fi
fi
exit ;;
avr32*:Linux:*:*)
@@ -874,7 +900,21 @@ EOF
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo frv-unknown-linux-gnu
+ exit ;;
+ hexagon:Linux:*:*)
+ echo hexagon-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -901,39 +941,18 @@ EOF
#endif
#endif
EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -942,14 +961,17 @@ EOF
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -957,6 +979,9 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
@@ -964,60 +989,8 @@ EOF
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
@@ -1025,11 +998,11 @@ EOF
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
+ # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
@@ -1061,7 +1034,7 @@ EOF
fi
exit ;;
i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
@@ -1089,13 +1062,13 @@ EOF
exit ;;
pc:*:*:*)
# Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
- exit ;;
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
@@ -1130,8 +1103,8 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
@@ -1174,10 +1147,10 @@ EOF
echo ns32k-sni-sysv
fi
exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
@@ -1203,11 +1176,11 @@ EOF
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
@@ -1247,6 +1220,16 @@ EOF
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1262,6 +1245,9 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
@@ -1307,13 +1293,13 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
@@ -1353,11 +1339,11 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
diff --git a/gr-howto-write-a-block/config.sub b/gr-howto-write-a-block/config.sub
index eb0389a69..5b8736823 100755
--- a/gr-howto-write-a-block/config.sub
+++ b/gr-howto-write-a-block/config.sub
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
-timestamp='2009-06-11'
+timestamp='2011-10-08'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -32,13 +32,16 @@ timestamp='2009-06-11'
# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
@@ -72,8 +75,9 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -120,8 +124,9 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
@@ -149,12 +154,12 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
+ -apple | -axis | -knuth | -cray | -microblaze)
os=
basic_machine=$1
;;
- -bluegene*)
- os=-cnk
+ -bluegene*)
+ os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
@@ -170,10 +175,10 @@ case $os in
os=-chorusos
basic_machine=$1
;;
- -chorusrdb)
- os=-chorusrdb
+ -chorusrdb)
+ os=-chorusrdb
basic_machine=$1
- ;;
+ ;;
-hiux*)
os=-hiuxwe2
;;
@@ -246,13 +251,17 @@ case $basic_machine in
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
+ | epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \
@@ -278,26 +287,39 @@ case $basic_machine in
| moxie \
| mt \
| msp430 \
+ | nds32 | nds32le | nds32be \
| nios | nios2 \
| ns16k | ns32k \
+ | open8 \
| or32 \
| pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
+ | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12)
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
@@ -308,6 +330,18 @@ case $basic_machine in
basic_machine=mt-unknown
;;
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@@ -327,20 +361,23 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | be32-* | be64-* \
| bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -362,24 +399,29 @@ case $basic_machine in
| mmix-* \
| mt-* \
| msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
- | romp-* | rs6000-* \
+ | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
| tron-* \
- | v850-* | v850e-* | vax-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
@@ -404,7 +446,7 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
- abacus)
+ abacus)
basic_machine=abacus-unknown
;;
adobe68k)
@@ -474,11 +516,20 @@ case $basic_machine in
basic_machine=powerpc-ibm
os=-cnk
;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
- cegcc)
+ cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
@@ -510,7 +561,7 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16)
+ cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
@@ -726,6 +777,9 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
mingw32)
basic_machine=i386-pc
os=-mingw32
@@ -766,6 +820,10 @@ case $basic_machine in
basic_machine=i370-ibm
os=-mvs
;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@@ -830,6 +888,12 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -912,9 +976,10 @@ case $basic_machine in
;;
power) basic_machine=power-ibm
;;
- ppc) basic_machine=powerpc-unknown
+ ppc | ppcbe) basic_machine=powerpc-unknown
;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
@@ -1008,6 +1073,9 @@ case $basic_machine in
basic_machine=i860-stratus
os=-sysv4
;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
sun2)
basic_machine=m68000-sun
;;
@@ -1064,20 +1132,8 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
tile*)
- basic_machine=tile-unknown
+ basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
@@ -1147,6 +1203,9 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
ymp)
basic_machine=ymp-cray
os=-unicos
@@ -1244,9 +1303,12 @@ esac
if [ x"$os" != x"" ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
+ # First match some system type aliases
+ # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
@@ -1268,8 +1330,8 @@ case $os in
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -kopensolaris* \
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
@@ -1282,7 +1344,8 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1290,7 +1353,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1329,7 +1392,7 @@ case $os in
-opened*)
os=-openedition
;;
- -os400*)
+ -os400*)
os=-os400
;;
-wince*)
@@ -1378,7 +1441,7 @@ case $os in
-sinix*)
os=-sysv4
;;
- -tpf*)
+ -tpf*)
os=-tpf
;;
-triton*)
@@ -1423,6 +1486,8 @@ case $os in
-dicos*)
os=-dicos
;;
+ -nacl*)
+ ;;
-none)
;;
*)
@@ -1445,10 +1510,10 @@ else
# system, and we'll never get to this point.
case $basic_machine in
- score-*)
+ score-*)
os=-elf
;;
- spu-*)
+ spu-*)
os=-elf
;;
*-acorn)
@@ -1460,8 +1525,17 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
@@ -1488,7 +1562,7 @@ case $basic_machine in
m68*-cisco)
os=-aout
;;
- mep-*)
+ mep-*)
os=-elf
;;
mips*-cisco)
@@ -1515,7 +1589,7 @@ case $basic_machine in
*-ibm)
os=-aix
;;
- *-knuth)
+ *-knuth)
os=-mmixware
;;
*-wec)
diff --git a/gr-qtgui/lib/ConstellationDisplayPlot.cc b/gr-qtgui/lib/ConstellationDisplayPlot.cc
index dda7cfea2..ca7eede36 100644
--- a/gr-qtgui/lib/ConstellationDisplayPlot.cc
+++ b/gr-qtgui/lib/ConstellationDisplayPlot.cc
@@ -68,11 +68,17 @@ ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget* parent)
_imagDataPoints = new double[_numPoints];
// Disable polygon clipping
+#if QWT_VERSION < 0x060000
QwtPainter::setDeviceClipping(false);
+#else
+ QwtPainter::setPolylineSplitting(false);
+#endif
+#if QWT_VERSION < 0x060000
// We don't need the cache here
canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
+#endif
QPalette palette;
palette.setColor(canvas()->backgroundRole(), QColor("white"));
@@ -91,13 +97,22 @@ ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget* parent)
_plot_curve->attach(this);
_plot_curve->setPen(QPen(Qt::blue, _penSize, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
_plot_curve->setStyle(QwtPlotCurve::Dots);
+
+#if QWT_VERSION < 0x060000
_plot_curve->setRawData(_realDataPoints, _imagDataPoints, _numPoints);
+#else
+ _plot_curve->setRawSamples(_realDataPoints, _imagDataPoints, _numPoints);
+#endif
memset(_realDataPoints, 0x0, _numPoints*sizeof(double));
memset(_imagDataPoints, 0x0, _numPoints*sizeof(double));
_zoomer = new ConstellationDisplayZoomer(canvas());
+
+#if QWT_VERSION < 0x060000
_zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
+#endif
+
_zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
_zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
@@ -120,8 +135,14 @@ ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget* parent)
// emit the position of clicks on widget
_picker = new QwtDblClickPlotPicker(canvas());
+
+#if QWT_VERSION < 0x060000
connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
- this, SLOT(OnPickerPointSelected(const QwtDoublePoint &)));
+ this, SLOT(OnPickerPointSelected(const QwtDoublePoint &)));
+#else
+ connect(_picker, SIGNAL(selected(const QPointF &)),
+ this, SLOT(OnPickerPointSelected(const QPointF &)));
+#endif
connect(this, SIGNAL(legendChecked(QwtPlotItem *, bool ) ),
this, SLOT(LegendEntryChecked(QwtPlotItem *, bool ) ));
@@ -193,12 +214,18 @@ void ConstellationDisplayPlot::PlotNewData(const double* realDataPoints,
_realDataPoints = new double[_numPoints];
_imagDataPoints = new double[_numPoints];
+#if QWT_VERSION < 0x060000
_plot_curve->setRawData(_realDataPoints, _imagDataPoints, _numPoints);
+#else
+ _plot_curve->setRawSamples(_realDataPoints, _imagDataPoints, _numPoints);
+#endif
}
memcpy(_realDataPoints, realDataPoints, numDataPoints*sizeof(double));
memcpy(_imagDataPoints, imagDataPoints, numDataPoints*sizeof(double));
+ replot();
+
_lastReplot = gruel::high_res_timer_now();
}
}
@@ -209,6 +236,7 @@ ConstellationDisplayPlot::LegendEntryChecked(QwtPlotItem* plotItem, bool on)
plotItem->setVisible(!on);
}
+#if QWT_VERSION < 0x060000
void
ConstellationDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
{
@@ -216,5 +244,14 @@ ConstellationDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
//fprintf(stderr,"OnPickerPointSelected %f %f\n", point.x(), point.y());
emit plotPointSelected(point);
}
+#else
+void
+ConstellationDisplayPlot::OnPickerPointSelected(const QPointF & p)
+{
+ QPointF point = p;
+ //fprintf(stderr,"OnPickerPointSelected %f %f\n", point.x(), point.y());
+ emit plotPointSelected(point);
+}
+#endif
#endif /* CONSTELLATION_DISPLAY_PLOT_C */
diff --git a/gr-qtgui/lib/ConstellationDisplayPlot.h b/gr-qtgui/lib/ConstellationDisplayPlot.h
index 23004f86c..d252a8c87 100644
--- a/gr-qtgui/lib/ConstellationDisplayPlot.h
+++ b/gr-qtgui/lib/ConstellationDisplayPlot.h
@@ -38,6 +38,11 @@
#include <qwt_symbol.h>
#include <qtgui_util.h>
+#if QWT_VERSION >= 0x060000
+#include <qwt_point_3d.h> // doesn't seem necessary, but is...
+#include <qwt_compat.h>
+#endif
+
class ConstellationDisplayPlot : public QwtPlot
{
Q_OBJECT
@@ -62,7 +67,11 @@ public:
public slots:
void resizeSlot( QSize *s );
+#if QWT_VERSION < 0x060000
void OnPickerPointSelected(const QwtDoublePoint & p);
+#else
+ void OnPickerPointSelected(const QPointF & p);
+#endif
signals:
void plotPointSelected(const QPointF p);
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc b/gr-qtgui/lib/FrequencyDisplayPlot.cc
index f57edd8f6..2e62f2b96 100644
--- a/gr-qtgui/lib/FrequencyDisplayPlot.cc
+++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc
@@ -133,11 +133,17 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(QWidget* parent)
_xAxisPoints = new double[_numPoints];
// Disable polygon clipping
+#if QWT_VERSION < 0x060000
QwtPainter::setDeviceClipping(false);
+#else
+ QwtPainter::setPolylineSplitting(false);
+#endif
+#if QWT_VERSION < 0x060000
// We don't need the cache here
canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
+#endif
QPalette palette;
palette.setColor(canvas()->backgroundRole(), QColor("white"));
@@ -156,18 +162,35 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(QWidget* parent)
_fft_plot_curve = new QwtPlotCurve("Power Spectrum");
_fft_plot_curve->attach(this);
_fft_plot_curve->setPen(QPen(Qt::blue));
+
+#if QWT_VERSION < 0x060000
_fft_plot_curve->setRawData(_xAxisPoints, _dataPoints, _numPoints);
+#else
+ _fft_plot_curve->setRawSamples(_xAxisPoints, _dataPoints, _numPoints);
+#endif
_min_fft_plot_curve = new QwtPlotCurve("Minimum Power");
_min_fft_plot_curve->attach(this);
_min_fft_plot_curve->setPen(QPen(Qt::magenta));
+
+#if QWT_VERSION < 0x060000
_min_fft_plot_curve->setRawData(_xAxisPoints, _minFFTPoints, _numPoints);
+#else
+ _min_fft_plot_curve->setRawSamples(_xAxisPoints, _minFFTPoints, _numPoints);
+#endif
+
_min_fft_plot_curve->setVisible(false);
_max_fft_plot_curve = new QwtPlotCurve("Maximum Power");
_max_fft_plot_curve->attach(this);
_max_fft_plot_curve->setPen(QPen(Qt::darkYellow));
+
+#if QWT_VERSION < 0x060000
_max_fft_plot_curve->setRawData(_xAxisPoints, _maxFFTPoints, _numPoints);
+#else
+ _max_fft_plot_curve->setRawSamples(_xAxisPoints, _maxFFTPoints, _numPoints);
+#endif
+
_max_fft_plot_curve->setVisible(false);
_lower_intensity_marker= new QwtPlotMarker();
@@ -197,9 +220,16 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(QWidget* parent)
symbol.setSize(8);
symbol.setPen(QPen(Qt::yellow));
symbol.setBrush(QBrush(Qt::yellow));
+
+#if QWT_VERSION < 0x060000
_markerPeakAmplitude->setSymbol(symbol);
- _markerPeakAmplitude->attach(this);
+#else
+ _markerPeakAmplitude->setSymbol(&symbol);
+#endif
+ /// THIS CAUSES A PROBLEM!
+ //_markerPeakAmplitude->attach(this);
+
_markerNoiseFloorAmplitude = new QwtPlotMarker();
_markerNoiseFloorAmplitude->setLineStyle(QwtPlotMarker::HLine);
_markerNoiseFloorAmplitude->setLinePen(QPen(Qt::darkRed, 0, Qt::DotLine));
@@ -220,15 +250,25 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(QWidget* parent)
// emit the position of clicks on widget
_picker = new QwtDblClickPlotPicker(canvas());
+
+#if QWT_VERSION < 0x060000
connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
this, SLOT(OnPickerPointSelected(const QwtDoublePoint &)));
+#else
+ connect(_picker, SIGNAL(selected(const QPointF &)),
+ this, SLOT(OnPickerPointSelected(const QPointF &)));
+#endif
// Configure magnify on mouse wheel
_magnifier = new QwtPlotMagnifier(canvas());
_magnifier->setAxisEnabled(QwtPlot::xBottom, false);
_zoomer = new FreqDisplayZoomer(canvas(), 0);
+
+#if QWT_VERSION < 0x060000
_zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
+#endif
+
_zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
_zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
@@ -362,7 +402,7 @@ FrequencyDisplayPlot::PlotNewData(const double* dataPoints, const int64_t numDat
{
// Only update plot if there is data and if the time interval has elapsed
if((numDataPoints > 0) &&
- (gruel::high_res_timer_now() - _lastReplot > timeInterval*gruel::high_res_timer_tps())) {
+ (gruel::high_res_timer_now() - _lastReplot > timeInterval*gruel::high_res_timer_tps())) {
if(numDataPoints != _numPoints) {
_numPoints = numDataPoints;
@@ -375,16 +415,22 @@ FrequencyDisplayPlot::PlotNewData(const double* dataPoints, const int64_t numDat
_xAxisPoints = new double[_numPoints];
_minFFTPoints = new double[_numPoints];
_maxFFTPoints = new double[_numPoints];
-
+
+#if QWT_VERSION < 0x060000
_fft_plot_curve->setRawData(_xAxisPoints, _dataPoints, _numPoints);
_min_fft_plot_curve->setRawData(_xAxisPoints, _minFFTPoints, _numPoints);
_max_fft_plot_curve->setRawData(_xAxisPoints, _maxFFTPoints, _numPoints);
+#else
+ _fft_plot_curve->setRawSamples(_xAxisPoints, _dataPoints, _numPoints);
+ _min_fft_plot_curve->setRawSamples(_xAxisPoints, _minFFTPoints, _numPoints);
+ _max_fft_plot_curve->setRawSamples(_xAxisPoints, _maxFFTPoints, _numPoints);
+#endif
_resetXAxisPoints();
ClearMaxData();
ClearMinData();
}
-
+
memcpy(_dataPoints, dataPoints, numDataPoints*sizeof(double));
for(int64_t point = 0; point < numDataPoints; point++){
if(dataPoints[point] < _minFFTPoints[point]){
@@ -401,6 +447,8 @@ FrequencyDisplayPlot::PlotNewData(const double* dataPoints, const int64_t numDat
SetUpperIntensityLevel(_peakAmplitude);
+ replot();
+
_lastReplot = gruel::high_res_timer_now();
}
}
@@ -478,7 +526,7 @@ FrequencyDisplayPlot::SetBGColour (QColor c)
{
QPalette palette;
palette.setColor(canvas()->backgroundRole(), c);
- canvas()->setPalette(palette);
+ canvas()->setPalette(palette);
}
void
@@ -490,6 +538,7 @@ FrequencyDisplayPlot::ShowCFMarker (const bool show)
_markerCF->hide();
}
+#if QWT_VERSION < 0x060000
void
FrequencyDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
{
@@ -498,5 +547,15 @@ FrequencyDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
point.setX(point.x() * _xAxisMultiplier);
emit plotPointSelected(point);
}
+#else
+void
+FrequencyDisplayPlot::OnPickerPointSelected(const QPointF & p)
+{
+ QPointF point = p;
+ //fprintf(stderr,"OnPickerPointSelected %f %f %d\n", point.x(), point.y(), _xAxisMultiplier);
+ point.setX(point.x() * _xAxisMultiplier);
+ emit plotPointSelected(point);
+}
+#endif
#endif /* FREQUENCY_DISPLAY_PLOT_C */
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.h b/gr-qtgui/lib/FrequencyDisplayPlot.h
index a263fec2f..961f30168 100644
--- a/gr-qtgui/lib/FrequencyDisplayPlot.h
+++ b/gr-qtgui/lib/FrequencyDisplayPlot.h
@@ -39,6 +39,10 @@
#include <qwt_symbol.h>
#include <qtgui_util.h>
+#if QWT_VERSION >= 0x060000
+#include <qwt_compat.h>
+#endif
+
class FrequencyDisplayPlot:public QwtPlot{
Q_OBJECT
@@ -76,7 +80,11 @@ public slots:
void SetLowerIntensityLevel(const double);
void SetUpperIntensityLevel(const double);
+#if QWT_VERSION < 0x060000
void OnPickerPointSelected(const QwtDoublePoint & p);
+#else
+ void OnPickerPointSelected(const QPointF & p);
+#endif
signals:
void plotPointSelected(const QPointF p);
@@ -107,6 +115,7 @@ private:
QwtPlotMarker *_markerCF;
QwtDblClickPlotPicker *_picker;
+
QwtPlotMagnifier *_magnifier;
double* _dataPoints;
diff --git a/gr-qtgui/lib/Makefile.am b/gr-qtgui/lib/Makefile.am
index 849ee8360..3257c3aae 100644
--- a/gr-qtgui/lib/Makefile.am
+++ b/gr-qtgui/lib/Makefile.am
@@ -70,11 +70,11 @@ grinclude_HEADERS = \
WaterfallDisplayPlot.h \
waterfallGlobalData.h \
ConstellationDisplayPlot.h \
- plot_waterfall.h \
spectrumdisplayform.h \
timedisplayform.h \
SpectrumGUIClass.h \
spectrumUpdateEvents.h \
+ plot_waterfall.h \
gr_qtgui_api.h \
qtgui_sink_c.h \
qtgui_sink_f.h \
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index f635a2b0c..eca6076b6 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -103,14 +103,23 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent)
memset(_xAxisPoints, 0x0, _numPoints*sizeof(double));
_zoomer = new TimeDomainDisplayZoomer(canvas(), 0);
+
+#if QWT_VERSION < 0x060000
_zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
+#endif
// Disable polygon clipping
+#if QWT_VERSION < 0x060000
QwtPainter::setDeviceClipping(false);
+#else
+ QwtPainter::setPolylineSplitting(false);
+#endif
+#if QWT_VERSION < 0x060000
// We don't need the cache here
canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
+#endif
QPalette palette;
palette.setColor(canvas()->backgroundRole(), QColor("white"));
@@ -130,8 +139,6 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent)
<< QColor(Qt::yellow) << QColor(Qt::gray) << QColor(Qt::darkRed)
<< QColor(Qt::darkGreen) << QColor(Qt::darkBlue) << QColor(Qt::darkGray);
- int ncolors = colors.size();
-
// Setup dataPoints and plot vectors
// Automatically deleted when parent is deleted
for(int i = 0; i < _nplots; i++) {
@@ -141,8 +148,13 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent)
_plot_curve.push_back(new QwtPlotCurve(QString("Data %1").arg(i)));
_plot_curve[i]->attach(this);
_plot_curve[i]->setPen(QPen(colors[i]));
+
+#if QWT_VERSION < 0x060000
_plot_curve[i]->setRawData(_xAxisPoints, _dataPoints[i], _numPoints);
- }
+#else
+ _plot_curve[i]->setRawSamples(_xAxisPoints, _dataPoints[i], _numPoints);
+#endif
+}
_sampleRate = 1;
_resetXAxisPoints();
@@ -158,8 +170,14 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent)
// emit the position of clicks on widget
_picker = new QwtDblClickPlotPicker(canvas());
+
+#if QWT_VERSION < 0x060000
connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
this, SLOT(OnPickerPointSelected(const QwtDoublePoint &)));
+#else
+ connect(_picker, SIGNAL(selected(const QPointF &)),
+ this, SLOT(OnPickerPointSelected(const QPointF &)));
+#endif
// Configure magnify on mouse wheel
_magnifier = new QwtPlotMagnifier(canvas());
@@ -245,7 +263,12 @@ void TimeDomainDisplayPlot::PlotNewData(const std::vector<double*> dataPoints,
for(int i = 0; i < _nplots; i++) {
delete[] _dataPoints[i];
_dataPoints[i] = new double[_numPoints];
+
+#if QWT_VERSION < 0x060000
_plot_curve[i]->setRawData(_xAxisPoints, _dataPoints[i], _numPoints);
+#else
+ _plot_curve[i]->setRawSamples(_xAxisPoints, _dataPoints[i], _numPoints);
+#endif
}
setXaxis(0, numDataPoints);
@@ -255,6 +278,8 @@ void TimeDomainDisplayPlot::PlotNewData(const std::vector<double*> dataPoints,
for(int i = 0; i < _nplots; i++) {
memcpy(_dataPoints[i], dataPoints[i], numDataPoints*sizeof(double));
}
+
+ replot();
}
}
@@ -300,6 +325,8 @@ TimeDomainDisplayPlot::SetSampleRate(double sr, double units,
}
}
+
+#if QWT_VERSION < 0x060000
void
TimeDomainDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
{
@@ -307,5 +334,14 @@ TimeDomainDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
//fprintf(stderr,"OnPickerPointSelected %f %f\n", point.x(), point.y());
emit plotPointSelected(point);
}
+#else
+void
+TimeDomainDisplayPlot::OnPickerPointSelected(const QPointF & p)
+{
+ QPointF point = p;
+ //fprintf(stderr,"OnPickerPointSelected %f %f\n", point.x(), point.y());
+ emit plotPointSelected(point);
+}
+#endif
#endif /* TIME_DOMAIN_DISPLAY_PLOT_C */
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h
index af87e1b14..6c7fc4330 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.h
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h
@@ -39,6 +39,10 @@
#include <qwt_symbol.h>
#include <qtgui_util.h>
+#if QWT_VERSION >= 0x060000
+#include <qwt_compat.h>
+#endif
+
class TimeDomainDisplayPlot:public QwtPlot{
Q_OBJECT
@@ -61,7 +65,11 @@ public slots:
void SetSampleRate(double sr, double units,
const std::string &strunits);
+#if QWT_VERSION < 0x060000
void OnPickerPointSelected(const QwtDoublePoint & p);
+#else
+ void OnPickerPointSelected(const QPointF & p);
+#endif
signals:
void plotPointSelected(const QPointF p);
diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.cc b/gr-qtgui/lib/WaterfallDisplayPlot.cc
index 1476be2bd..94a8e6210 100644
--- a/gr-qtgui/lib/WaterfallDisplayPlot.cc
+++ b/gr-qtgui/lib/WaterfallDisplayPlot.cc
@@ -230,6 +230,58 @@ private:
std::string _unitType;
};
+class ColorMap_MultiColor: public QwtLinearColorMap
+{
+public:
+ ColorMap_MultiColor():
+ QwtLinearColorMap(Qt::darkCyan, Qt::white)
+ {
+ addColorStop(0.25, Qt::cyan);
+ addColorStop(0.5, Qt::yellow);
+ addColorStop(0.75, Qt::red);
+ }
+};
+
+class ColorMap_WhiteHot: public QwtLinearColorMap
+{
+public:
+ ColorMap_WhiteHot():
+ QwtLinearColorMap(Qt::black, Qt::white)
+ {
+ }
+};
+
+class ColorMap_BlackHot: public QwtLinearColorMap
+{
+public:
+ ColorMap_BlackHot():
+ QwtLinearColorMap(Qt::white, Qt::black)
+ {
+ }
+};
+
+class ColorMap_Incandescent: public QwtLinearColorMap
+{
+public:
+ ColorMap_Incandescent():
+ QwtLinearColorMap(Qt::black, Qt::white)
+ {
+ addColorStop(0.5, Qt::darkRed);
+ }
+};
+
+class ColorMap_UserDefined: public QwtLinearColorMap
+{
+public:
+ ColorMap_UserDefined(QColor low, QColor high):
+ QwtLinearColorMap(low, high)
+ {
+ }
+};
+
+/*********************************************************************
+MAIN WATERFALL PLOT WIDGET
+*********************************************************************/
WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
: QwtPlot(parent)
@@ -241,8 +293,6 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
resize(parent->width(), parent->height());
_numPoints = 1024;
- _waterfallData = new WaterfallData(_startFrequency, _stopFrequency, _numPoints, 200);
-
QPalette palette;
palette.setColor(canvas()->backgroundRole(), QColor("white"));
canvas()->setPalette(palette);
@@ -255,26 +305,34 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
_lastReplot = 0;
- d_spectrogram = new PlotWaterfall(_waterfallData, "Waterfall Display");
-
_intensityColorMapType = INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR;
- QwtLinearColorMap colorMap(Qt::darkCyan, Qt::white);
- colorMap.addColorStop(0.25, Qt::cyan);
- colorMap.addColorStop(0.5, Qt::yellow);
- colorMap.addColorStop(0.75, Qt::red);
+ d_data = new WaterfallData(_startFrequency, _stopFrequency,
+ _numPoints, 200);
+
+#if QWT_VERSION < 0x060000
+ d_spectrogram = new PlotWaterfall(d_data, "Waterfall Display");
+ ColorMap_MultiColor colorMap;
d_spectrogram->setColorMap(colorMap);
-
+
+#else
+ d_spectrogram = new QwtPlotSpectrogram("Spectrogram");
+ d_spectrogram->setData(d_data);
+ d_spectrogram->setDisplayMode(QwtPlotSpectrogram::ImageMode, true);
+ d_spectrogram->setColorMap(new ColorMap_MultiColor());
+#endif
+
d_spectrogram->attach(this);
// LeftButton for the zooming
// MidButton for the panning
// RightButton: zoom out by 1
// Ctrl+RighButton: zoom out to full size
-
_zoomer = new WaterfallZoomer(canvas(), 0);
+#if QWT_VERSION < 0x060000
_zoomer->setSelectionFlags(QwtPicker::RectSelection | QwtPicker::DragSelection);
+#endif
_zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
_zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
@@ -286,9 +344,14 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
// emit the position of clicks on widget
_picker = new QwtDblClickPlotPicker(canvas());
+#if QWT_VERSION < 0x060000
connect(_picker, SIGNAL(selected(const QwtDoublePoint &)),
this, SLOT(OnPickerPointSelected(const QwtDoublePoint &)));
-
+#else
+ connect(_picker, SIGNAL(selected(const QPointF &)),
+ this, SLOT(OnPickerPointSelected(const QPointF &)));
+#endif
+
// Avoid jumping when labels with more/less digits
// appear/disappear when scrolling vertically
@@ -296,7 +359,7 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
QwtScaleDraw *sd = axisScaleDraw(QwtPlot::yLeft);
sd->setMinimumExtent( fm.width("100.00") );
- const QColor c(Qt::white);
+ const QColor c(Qt::black);
_zoomer->setRubberBandPen(c);
_zoomer->setTrackerPen(c);
@@ -307,15 +370,15 @@ WaterfallDisplayPlot::WaterfallDisplayPlot(QWidget* parent)
WaterfallDisplayPlot::~WaterfallDisplayPlot()
{
- delete _waterfallData;
+ delete d_data;
delete d_spectrogram;
}
void
WaterfallDisplayPlot::Reset()
{
- _waterfallData->ResizeData(_startFrequency, _stopFrequency, _numPoints);
- _waterfallData->Reset();
+ d_data->ResizeData(_startFrequency, _stopFrequency, _numPoints);
+ d_data->Reset();
setAxisScale(QwtPlot::xBottom, _startFrequency, _stopFrequency);
@@ -408,9 +471,8 @@ WaterfallDisplayPlot::PlotNewData(const double* dataPoints,
}
if(gruel::high_res_timer_now() - _lastReplot > timePerFFT*gruel::high_res_timer_tps()) {
- //FIXME: We may want to average the data between these updates to smooth display
- _waterfallData->addFFTData(dataPoints, numDataPoints, droppedFrames);
- _waterfallData->IncrementNumLinesToUpdate();
+ d_data->addFFTData(dataPoints, numDataPoints, droppedFrames);
+ d_data->IncrementNumLinesToUpdate();
QwtTimeScaleDraw* timeScale = (QwtTimeScaleDraw*)axisScaleDraw(QwtPlot::yLeft);
timeScale->SetSecondsPerLine(timePerFFT);
@@ -421,7 +483,7 @@ WaterfallDisplayPlot::PlotNewData(const double* dataPoints,
d_spectrogram->invalidateCache();
d_spectrogram->itemChanged();
-
+
replot();
_lastReplot = gruel::high_res_timer_now();
@@ -431,9 +493,13 @@ WaterfallDisplayPlot::PlotNewData(const double* dataPoints,
void
WaterfallDisplayPlot::SetIntensityRange(const double minIntensity,
- const double maxIntensity)
+ const double maxIntensity)
{
- _waterfallData->setRange(QwtDoubleInterval(minIntensity, maxIntensity));
+#if QWT_VERSION < 0x060000
+ d_data->setRange(QwtDoubleInterval(minIntensity, maxIntensity));
+#else
+ d_data->setInterval(Qt::ZAxis, QwtInterval(minIntensity, maxIntensity));
+#endif
emit UpdatedLowerIntensityLevel(minIntensity);
emit UpdatedUpperIntensityLevel(maxIntensity);
@@ -447,7 +513,8 @@ WaterfallDisplayPlot::replot()
QwtTimeScaleDraw* timeScale = (QwtTimeScaleDraw*)axisScaleDraw(QwtPlot::yLeft);
timeScale->initiateUpdate();
- WaterfallFreqDisplayScaleDraw* freqScale = (WaterfallFreqDisplayScaleDraw*)axisScaleDraw(QwtPlot::xBottom);
+ WaterfallFreqDisplayScaleDraw* freqScale = \
+ (WaterfallFreqDisplayScaleDraw*)axisScaleDraw(QwtPlot::xBottom);
freqScale->initiateUpdate();
// Update the time axis display
@@ -490,38 +557,54 @@ WaterfallDisplayPlot::SetIntensityColorMapType(const int newType,
switch(newType){
case INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR:{
_intensityColorMapType = newType;
- QwtLinearColorMap colorMap(Qt::darkCyan, Qt::white);
- colorMap.addColorStop(0.25, Qt::cyan);
- colorMap.addColorStop(0.5, Qt::yellow);
- colorMap.addColorStop(0.75, Qt::red);
+#if QWT_VERSION < 0x060000
+ ColorMap_MultiColor colorMap;
d_spectrogram->setColorMap(colorMap);
+#else
+ d_spectrogram->setColorMap(new ColorMap_MultiColor());
+#endif
break;
}
case INTENSITY_COLOR_MAP_TYPE_WHITE_HOT:{
_intensityColorMapType = newType;
- QwtLinearColorMap colorMap(Qt::black, Qt::white);
+#if QWT_VERSION < 0x060000
+ ColorMap_WhiteHot colorMap;
d_spectrogram->setColorMap(colorMap);
+#else
+ d_spectrogram->setColorMap(new ColorMap_WhiteHot());
+#endif
break;
}
case INTENSITY_COLOR_MAP_TYPE_BLACK_HOT:{
_intensityColorMapType = newType;
- QwtLinearColorMap colorMap(Qt::white, Qt::black);
+#if QWT_VERSION < 0x060000
+ ColorMap_BlackHot colorMap;
d_spectrogram->setColorMap(colorMap);
+#else
+ d_spectrogram->setColorMap(new ColorMap_BlackHot());
+#endif
break;
}
case INTENSITY_COLOR_MAP_TYPE_INCANDESCENT:{
_intensityColorMapType = newType;
- QwtLinearColorMap colorMap(Qt::black, Qt::white);
- colorMap.addColorStop(0.5, Qt::darkRed);
+#if QWT_VERSION < 0x060000
+ ColorMap_Incandescent colorMap;
d_spectrogram->setColorMap(colorMap);
+#else
+ d_spectrogram->setColorMap(new ColorMap_Incandescent());
+#endif
break;
}
case INTENSITY_COLOR_MAP_TYPE_USER_DEFINED:{
_userDefinedLowIntensityColor = lowColor;
_userDefinedHighIntensityColor = highColor;
_intensityColorMapType = newType;
- QwtLinearColorMap colorMap(_userDefinedLowIntensityColor, _userDefinedHighIntensityColor);
+#if QWT_VERSION < 0x060000
+ ColorMap_UserDefined colorMap(lowColor, highColor);
d_spectrogram->setColorMap(colorMap);
+#else
+ d_spectrogram->setColorMap(new ColorMap_UserDefined(lowColor, highColor));
+#endif
break;
}
default: break;
@@ -549,12 +632,33 @@ WaterfallDisplayPlot::_UpdateIntensityRangeDisplay()
QwtScaleWidget *rightAxis = axisWidget(QwtPlot::yRight);
rightAxis->setTitle("Intensity (dB)");
rightAxis->setColorBarEnabled(true);
+
+#if QWT_VERSION < 0x060000
rightAxis->setColorMap(d_spectrogram->data()->range(),
d_spectrogram->colorMap());
-
setAxisScale(QwtPlot::yRight,
d_spectrogram->data()->range().minValue(),
- d_spectrogram->data()->range().maxValue() );
+ d_spectrogram->data()->range().maxValue());
+#else
+ QwtInterval intv = d_spectrogram->interval(Qt::ZAxis);
+ switch(_intensityColorMapType) {
+ case INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR:
+ rightAxis->setColorMap(intv, new ColorMap_MultiColor()); break;
+ case INTENSITY_COLOR_MAP_TYPE_WHITE_HOT:
+ rightAxis->setColorMap(intv, new ColorMap_WhiteHot()); break;
+ case INTENSITY_COLOR_MAP_TYPE_BLACK_HOT:
+ rightAxis->setColorMap(intv, new ColorMap_BlackHot()); break;
+ case INTENSITY_COLOR_MAP_TYPE_INCANDESCENT:
+ rightAxis->setColorMap(intv, new ColorMap_Incandescent()); break;
+ case INTENSITY_COLOR_MAP_TYPE_USER_DEFINED:
+ rightAxis->setColorMap(intv, new ColorMap_UserDefined(_userDefinedLowIntensityColor,
+ _userDefinedHighIntensityColor)); break;
+ default:
+ rightAxis->setColorMap(intv, new ColorMap_MultiColor()); break;
+ }
+ setAxisScale(QwtPlot::yRight, intv.minValue(), intv.maxValue());
+#endif
+
enableAxis(QwtPlot::yRight);
plotLayout()->setAlignCanvasToScales(true);
@@ -570,13 +674,24 @@ WaterfallDisplayPlot::_UpdateIntensityRangeDisplay()
_lastReplot = gruel::high_res_timer_now();
}
+#if QWT_VERSION < 0x060000
void
WaterfallDisplayPlot::OnPickerPointSelected(const QwtDoublePoint & p)
{
QPointF point = p;
- //fprintf(stderr,"OnPickerPointSelected %f %f %d\n", point.x(), point.y(), _xAxisMultiplier);
+ //fprintf(stderr,"OnPickerPointSelected %f %f\n", point.x(), point.y());
+ point.setX(point.x() * _xAxisMultiplier);
+ emit plotPointSelected(point);
+}
+#else
+void
+WaterfallDisplayPlot::OnPickerPointSelected(const QPointF & p)
+{
+ QPointF point = p;
+ //fprintf(stderr,"OnPickerPointSelected %f %f\n", point.x(), point.y());
point.setX(point.x() * _xAxisMultiplier);
emit plotPointSelected(point);
}
+#endif
#endif /* WATERFALL_DISPLAY_PLOT_C */
diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h
index 0c6a521b1..0458597b0 100644
--- a/gr-qtgui/lib/WaterfallDisplayPlot.h
+++ b/gr-qtgui/lib/WaterfallDisplayPlot.h
@@ -26,14 +26,20 @@
#include <stdint.h>
#include <cstdio>
#include <qwt_plot.h>
+#include <qwt_plot_spectrogram.h>
#include <qwt_plot_zoomer.h>
#include <qwt_plot_panner.h>
-
#include <qtgui_util.h>
-#include <plot_waterfall.h>
+#include <waterfallGlobalData.h>
#include <gruel/high_res_timer.h>
+#if QWT_VERSION < 0x060000
+#include <plot_waterfall.h>
+#else
+#include <qwt_compat.h>
+#endif
+
class WaterfallDisplayPlot:public QwtPlot{
Q_OBJECT
@@ -73,7 +79,12 @@ public:
public slots:
void resizeSlot( QSize *s );
+
+#if QWT_VERSION < 0x060000
void OnPickerPointSelected(const QwtDoublePoint & p);
+#else
+ void OnPickerPointSelected(const QPointF & p);
+#endif
signals:
void UpdatedLowerIntensityLevel(const double);
@@ -89,14 +100,18 @@ private:
double _stopFrequency;
int _xAxisMultiplier;
- PlotWaterfall *d_spectrogram;
-
QwtPlotPanner* _panner;
QwtPlotZoomer* _zoomer;
QwtDblClickPlotPicker *_picker;
- WaterfallData* _waterfallData;
+ WaterfallData *d_data;
+
+#if QWT_VERSION < 0x060000
+ PlotWaterfall *d_spectrogram;
+#else
+ QwtPlotSpectrogram *d_spectrogram;
+#endif
gruel::high_res_timer_type _lastReplot;
diff --git a/gr-qtgui/lib/plot_waterfall.cc b/gr-qtgui/lib/plot_waterfall.cc
index 2b1447e03..dbba657b8 100644
--- a/gr-qtgui/lib/plot_waterfall.cc
+++ b/gr-qtgui/lib/plot_waterfall.cc
@@ -2,85 +2,52 @@
#include <qpen.h>
#include <qpainter.h>
#include "qwt_painter.h"
-#include "qwt_double_interval.h"
#include "qwt_scale_map.h"
#include "qwt_color_map.h"
#include "plot_waterfall.h"
-#if QT_VERSION < 0x040000
-typedef Q3ValueVector<QRgb> QwtColorTable;
-#else
-typedef QVector<QRgb> QwtColorTable;
+#if QWT_VERSION < 0x060000
+#include "qwt_double_interval.h"
#endif
+typedef QVector<QRgb> QwtColorTable;
class PlotWaterfallImage: public QImage
{
// This class hides some Qt3/Qt4 API differences
public:
PlotWaterfallImage(const QSize &size, QwtColorMap::Format format):
-#if QT_VERSION < 0x040000
- QImage(size, format == QwtColorMap::RGB ? 32 : 8)
-#else
- QImage(size, format == QwtColorMap::RGB
- ? QImage::Format_ARGB32 : QImage::Format_Indexed8 )
-#endif
- {
- }
-
- PlotWaterfallImage(const QImage &other):
- QImage(other)
- {
- }
-
- void initColorTable(const QImage& other)
- {
-#if QT_VERSION < 0x040000
- const unsigned int numColors = other.numColors();
-
- setNumColors(numColors);
- for ( unsigned int i = 0; i < numColors; i++ )
- setColor(i, other.color(i));
-#else
- setColorTable(other.colorTable());
-#endif
- }
-
-#if QT_VERSION < 0x040000
-
- void setColorTable(const QwtColorTable &colorTable)
- {
- setNumColors(colorTable.size());
- for ( unsigned int i = 0; i < colorTable.size(); i++ )
- setColor(i, colorTable[i]);
- }
-
- QwtColorTable colorTable() const
- {
- QwtColorTable table(numColors());
- for ( int i = 0; i < numColors(); i++ )
- table[i] = color(i);
-
- return table;
- }
-#endif
+ QImage(size, format == QwtColorMap::RGB
+ ? QImage::Format_ARGB32 : QImage::Format_Indexed8 )
+ {
+ }
+
+ PlotWaterfallImage(const QImage &other):
+ QImage(other)
+ {
+ }
+
+ void initColorTable(const QImage& other)
+ {
+ setColorTable(other.colorTable());
+ }
};
class PlotWaterfall::PrivateData
{
public:
- PrivateData()
- {
- data = NULL;
- colorMap = new QwtLinearColorMap();
- }
- ~PrivateData()
- {
- delete colorMap;
- }
-
- WaterfallData *data;
- QwtColorMap *colorMap;
+ PrivateData()
+ {
+ data = NULL;
+ colorMap = new QwtLinearColorMap();
+ }
+ ~PrivateData()
+ {
+ delete colorMap;
+ }
+
+ WaterfallData *data;
+ QwtColorMap *colorMap;
};
/*!
@@ -138,7 +105,9 @@ int PlotWaterfall::rtti() const
void PlotWaterfall::setColorMap(const QwtColorMap &colorMap)
{
delete d_data->colorMap;
+#if QWT_VERSION < 0x060000
d_data->colorMap = colorMap.copy();
+#endif
invalidateCache();
itemChanged();
@@ -150,16 +119,19 @@ void PlotWaterfall::setColorMap(const QwtColorMap &colorMap)
*/
const QwtColorMap &PlotWaterfall::colorMap() const
{
- return *d_data->colorMap;
+ return *d_data->colorMap;
}
+
/*!
\return Bounding rect of the data
\sa QwtRasterData::boundingRect
*/
+#if QWT_VERSION < 0x060000
QwtDoubleRect PlotWaterfall::boundingRect() const
{
- return d_data->data->boundingRect();
+ return d_data->data->boundingRect();
}
+#endif
/*!
\brief Returns the recommended raster for a given rect.
@@ -170,10 +142,12 @@ QwtDoubleRect PlotWaterfall::boundingRect() const
\param rect Rect for the raster hint
\return data().rasterHint(rect)
*/
+#if QWT_VERSION < 0x060000
QSize PlotWaterfall::rasterHint(const QwtDoubleRect &rect) const
{
- return d_data->data->rasterHint(rect);
+ return d_data->data->rasterHint(rect);
}
+#endif
/*!
\brief Render an image from the data and color map.
@@ -192,19 +166,31 @@ QSize PlotWaterfall::rasterHint(const QwtDoubleRect &rect) const
\sa QwtRasterData::intensity(), QwtColorMap::rgb(),
QwtColorMap::colorIndex()
*/
-QImage PlotWaterfall::renderImage(
- const QwtScaleMap &xMap, const QwtScaleMap &yMap,
- const QwtDoubleRect &area) const
+#if QWT_VERSION < 0x060000
+QImage PlotWaterfall::renderImage(const QwtScaleMap &xMap,
+ const QwtScaleMap &yMap,
+ const QwtDoubleRect &area) const
+#else
+QImage PlotWaterfall::renderImage(const QwtScaleMap &xMap,
+ const QwtScaleMap &yMap,
+ const QRectF &area,
+ const QSize &size) const
+#endif
{
if ( area.isEmpty() )
return QImage();
+#if QWT_VERSION < 0x060000
QRect rect = transform(xMap, yMap, area);
+ const QSize res = d_data->data->rasterHint(area);
+#else
+ QRect rect(0,0,0,0);
+ const QSize res(0,0);
+#endif
QwtScaleMap xxMap = xMap;
QwtScaleMap yyMap = yMap;
- const QSize res = d_data->data->rasterHint(area);
if ( res.isValid() )
{
/*
@@ -243,7 +229,11 @@ QImage PlotWaterfall::renderImage(
PlotWaterfallImage image(rect.size(), d_data->colorMap->format());
+#if QWT_VERSION < 0x060000
const QwtDoubleInterval intensityRange = d_data->data->range();
+#else
+ const QwtInterval intensityRange = d_data->data->interval(Qt::ZAxis);
+#endif
if ( !intensityRange.isValid() )
return image;
@@ -292,13 +282,7 @@ QImage PlotWaterfall::renderImage(
const bool vInvert = yyMap.p1() < yyMap.p2();
if ( hInvert || vInvert )
{
-#ifdef __GNUC__
-#endif
-#if QT_VERSION < 0x040000
- image = image.mirror(hInvert, vInvert);
-#else
- image = image.mirrored(hInvert, vInvert);
-#endif
+ image = image.mirrored(hInvert, vInvert);
}
return image;
@@ -317,7 +301,8 @@ QImage PlotWaterfall::renderImage(
*/
void PlotWaterfall::draw(QPainter *painter,
- const QwtScaleMap &xMap, const QwtScaleMap &yMap,
+ const QwtScaleMap &xMap,
+ const QwtScaleMap &yMap,
const QRect &canvasRect) const
{
QwtPlotRasterItem::draw(painter, xMap, yMap, canvasRect);
diff --git a/gr-qtgui/lib/plot_waterfall.h b/gr-qtgui/lib/plot_waterfall.h
index a11461611..1613dd8de 100644
--- a/gr-qtgui/lib/plot_waterfall.h
+++ b/gr-qtgui/lib/plot_waterfall.h
@@ -3,9 +3,12 @@
#include <qglobal.h>
#include <waterfallGlobalData.h>
+#include <qwt_plot_rasteritem.h>
-#include "qwt_valuelist.h"
-#include "qwt_plot_rasteritem.h"
+#if QWT_VERSION >= 0x060000
+#include <qwt_point_3d.h> // doesn't seem necessary, but is...
+#include <qwt_compat.h>
+#endif
class QwtColorMap;
@@ -22,27 +25,39 @@ class QwtColorMap;
class PlotWaterfall: public QwtPlotRasterItem
{
public:
- explicit PlotWaterfall(WaterfallData* data, const QString &title = QString::null);
+ explicit PlotWaterfall(WaterfallData* data,
+ const QString &title = QString::null);
virtual ~PlotWaterfall();
const WaterfallData* data()const;
void setColorMap(const QwtColorMap &);
+
const QwtColorMap &colorMap() const;
+#if QWT_VERSION < 0x060000
virtual QwtDoubleRect boundingRect() const;
virtual QSize rasterHint(const QwtDoubleRect &) const;
+#endif
virtual int rtti() const;
virtual void draw(QPainter *p,
- const QwtScaleMap &xMap, const QwtScaleMap &yMap,
- const QRect &rect) const;
+ const QwtScaleMap &xMap,
+ const QwtScaleMap &yMap,
+ const QRect &rect) const;
protected:
- virtual QImage renderImage(
- const QwtScaleMap &xMap, const QwtScaleMap &yMap,
- const QwtDoubleRect &rect) const;
+#if QWT_VERSION < 0x060000
+ QImage renderImage(const QwtScaleMap &xMap,
+ const QwtScaleMap &yMap,
+ const QwtDoubleRect &rect) const;
+#else
+ QImage renderImage(const QwtScaleMap &xMap,
+ const QwtScaleMap &yMap,
+ const QRectF &rect,
+ const QSize &size=QSize(0,0)) const;
+#endif
private:
class PrivateData;
diff --git a/gr-qtgui/lib/qtgui_sink_f.h b/gr-qtgui/lib/qtgui_sink_f.h
index 30db05eea..6d43f18dd 100644
--- a/gr-qtgui/lib/qtgui_sink_f.h
+++ b/gr-qtgui/lib/qtgui_sink_f.h
@@ -29,7 +29,6 @@
#include <gr_firdes.h>
#include <gri_fft.h>
#include <qapplication.h>
-//#include <qtgui.h>
#include "SpectrumGUIClass.h"
class qtgui_sink_f;
diff --git a/gr-qtgui/lib/qtgui_util.cc b/gr-qtgui/lib/qtgui_util.cc
index 87b90997a..543ce1b1c 100644
--- a/gr-qtgui/lib/qtgui_util.cc
+++ b/gr-qtgui/lib/qtgui_util.cc
@@ -22,17 +22,24 @@
#include <qtgui_util.h>
+#if QWT_VERSION < 0x060000
QwtPickerDblClickPointMachine::QwtPickerDblClickPointMachine()
: QwtPickerMachine ()
{
-
}
+#else
+QwtPickerDblClickPointMachine::QwtPickerDblClickPointMachine()
+ : QwtPickerMachine (PointSelection)
+{
+}
+#endif
QwtPickerDblClickPointMachine::~QwtPickerDblClickPointMachine()
{
}
+#if QWT_VERSION < 0x060000
QwtPickerMachine::CommandList
QwtPickerDblClickPointMachine::transition(const QwtEventPattern &eventPattern,
const QEvent *e)
@@ -53,10 +60,35 @@ QwtPickerDblClickPointMachine::transition(const QwtEventPattern &eventPattern,
return cmdList;
}
+#else
+
+QList<QwtPickerMachine::Command>
+QwtPickerDblClickPointMachine::transition(const QwtEventPattern &eventPattern,
+ const QEvent *e)
+{
+ QList<QwtPickerMachine::Command> cmdList;
+ switch(e->type()) {
+ case QEvent::MouseButtonDblClick:
+ if ( eventPattern.mouseMatch(QwtEventPattern::MouseSelect1,
+ (const QMouseEvent *)e) ) {
+ cmdList += QwtPickerMachine::Begin;
+ cmdList += QwtPickerMachine::Append;
+ cmdList += QwtPickerMachine::End;
+ }
+ break;
+ default:
+ break;
+ }
+ return cmdList;
+}
+#endif
+
QwtDblClickPlotPicker::QwtDblClickPlotPicker(QwtPlotCanvas* canvas)
: QwtPlotPicker(canvas)
{
+#if QWT_VERSION < 0x060000
setSelectionFlags(QwtPicker::PointSelection);
+#endif
}
QwtDblClickPlotPicker::~QwtDblClickPlotPicker()
diff --git a/gr-qtgui/lib/qtgui_util.h b/gr-qtgui/lib/qtgui_util.h
index 5b129c7b5..7b3692e75 100644
--- a/gr-qtgui/lib/qtgui_util.h
+++ b/gr-qtgui/lib/qtgui_util.h
@@ -44,7 +44,14 @@ public:
QwtPickerDblClickPointMachine();
~QwtPickerDblClickPointMachine();
- virtual CommandList transition( const QwtEventPattern &eventPattern, const QEvent *e);
+#if QWT_VERSION < 0x060000
+ virtual CommandList transition( const QwtEventPattern &eventPattern,
+ const QEvent *e);
+#else
+ virtual QList<QwtPickerMachine::Command>
+ transition( const QwtEventPattern &eventPattern,
+ const QEvent *e);
+#endif
};
#endif /* INCLUDED_QTGUI_UTIL_H */
diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc
index 0e8594029..9fe553557 100644
--- a/gr-qtgui/lib/spectrumdisplayform.cc
+++ b/gr-qtgui/lib/spectrumdisplayform.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc.
+ * Copyright 2008-2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -35,7 +35,6 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent)
_intValidator->setBottom(0);
_frequencyDisplayPlot = new FrequencyDisplayPlot(FrequencyPlotDisplayFrame);
_waterfallDisplayPlot = new WaterfallDisplayPlot(WaterfallPlotDisplayFrame);
-
_timeDomainDisplayPlot = new TimeDomainDisplayPlot(2, TimeDomainDisplayFrame);
_constellationDisplayPlot = new ConstellationDisplayPlot(ConstellationDisplayFrame);
_numRealDataPoints = 1024;
@@ -62,9 +61,9 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent)
_noiseFloorAmplitude = -HUGE_VAL;
connect(_waterfallDisplayPlot, SIGNAL(UpdatedLowerIntensityLevel(const double)),
- _frequencyDisplayPlot, SLOT(SetLowerIntensityLevel(const double)));
+ _frequencyDisplayPlot, SLOT(SetLowerIntensityLevel(const double)));
connect(_waterfallDisplayPlot, SIGNAL(UpdatedUpperIntensityLevel(const double)),
- _frequencyDisplayPlot, SLOT(SetUpperIntensityLevel(const double)));
+ _frequencyDisplayPlot, SLOT(SetUpperIntensityLevel(const double)));
_frequencyDisplayPlot->SetLowerIntensityLevel(-200);
_frequencyDisplayPlot->SetUpperIntensityLevel(-200);
@@ -90,16 +89,16 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent)
// Connect double click signals up
connect(_frequencyDisplayPlot, SIGNAL(plotPointSelected(const QPointF)),
- this, SLOT(onFFTPlotPointSelected(const QPointF)));
+ this, SLOT(onFFTPlotPointSelected(const QPointF)));
connect(_waterfallDisplayPlot, SIGNAL(plotPointSelected(const QPointF)),
- this, SLOT(onWFallPlotPointSelected(const QPointF)));
+ this, SLOT(onWFallPlotPointSelected(const QPointF)));
connect(_timeDomainDisplayPlot, SIGNAL(plotPointSelected(const QPointF)),
- this, SLOT(onTimePlotPointSelected(const QPointF)));
+ this, SLOT(onTimePlotPointSelected(const QPointF)));
connect(_constellationDisplayPlot, SIGNAL(plotPointSelected(const QPointF)),
- this, SLOT(onConstPlotPointSelected(const QPointF)));
+ this, SLOT(onConstPlotPointSelected(const QPointF)));
}
SpectrumDisplayForm::~SpectrumDisplayForm()
@@ -242,7 +241,7 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate
_timeDomainDisplayPlot->PlotNewData(timeDomainDataPoints,
numTimeDomainDataPoints,
d_update_time);
- }
+ }
if(tabindex == d_plot_constellation) {
_constellationDisplayPlot->PlotNewData(realTimeDomainDataPoints,
imagTimeDomainDataPoints,
@@ -258,7 +257,6 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate
spectrumUpdateEvent->getDroppedFFTFrames());
}
}
-
// Tell the system the GUI has been updated
if(_systemSpecifiedFlag){
@@ -296,7 +294,6 @@ SpectrumDisplayForm::customEvent( QEvent * e)
if(_systemSpecifiedFlag){
WindowComboBox->setCurrentIndex(_system->GetWindowType());
FFTSizeComboBox->setCurrentIndex(_system->GetFFTSizeIndex());
- //FFTSizeComboBox->setCurrentIndex(1);
}
waterfallMinimumIntensityChangedCB(WaterfallMinimumIntensityWheel->value());
@@ -466,7 +463,8 @@ SpectrumDisplayForm::_AverageHistory(const double* newBuffer)
if(_historyEntryCount > static_cast<int>(_historyVector->size())){
_historyEntryCount = _historyVector->size();
}
- _historyEntry = (++_historyEntry)%_historyVector->size();
+ _historyEntry += 1;
+ _historyEntry = _historyEntry % _historyVector->size();
// Total up and then average the values
double sum;
diff --git a/gr-qtgui/lib/waterfallGlobalData.cc b/gr-qtgui/lib/waterfallGlobalData.cc
index 1ba153f0d..04366a297 100644
--- a/gr-qtgui/lib/waterfallGlobalData.cc
+++ b/gr-qtgui/lib/waterfallGlobalData.cc
@@ -2,14 +2,19 @@
#define WATERFALL_GLOBAL_DATA_CPP
#include <waterfallGlobalData.h>
+#include <cstdio>
WaterfallData::WaterfallData(const double minimumFrequency,
const double maximumFrequency,
const uint64_t fftPoints,
const unsigned int historyExtent)
+#if QWT_VERSION < 0x060000
: QwtRasterData(QwtDoubleRect(minimumFrequency /* X START */, 0 /* Y START */,
maximumFrequency - minimumFrequency /* WIDTH */,
static_cast<double>(historyExtent)/* HEIGHT */))
+#else
+ : QwtRasterData()
+#endif
{
_intensityRange = QwtDoubleInterval(-200.0, 0.0);
@@ -18,6 +23,12 @@ WaterfallData::WaterfallData(const double minimumFrequency,
_spectrumData = new double[_fftPoints * _historyLength];
+#if QWT_VERSION >= 0x060000
+ setInterval(Qt::XAxis, QwtInterval(minimumFrequency, maximumFrequency));
+ setInterval(Qt::YAxis, QwtInterval(0, historyExtent));
+ setInterval(Qt::ZAxis, QwtInterval(-200, 0.0));
+#endif
+
Reset();
}
@@ -35,6 +46,7 @@ void WaterfallData::Reset()
void WaterfallData::Copy(const WaterfallData* rhs)
{
+#if QWT_VERSION < 0x060000
if((_fftPoints != rhs->GetNumFFTPoints()) ||
(boundingRect() != rhs->boundingRect()) ){
_fftPoints = rhs->GetNumFFTPoints();
@@ -42,38 +54,78 @@ void WaterfallData::Copy(const WaterfallData* rhs)
delete[] _spectrumData;
_spectrumData = new double[_fftPoints * _historyLength];
}
+#else
+ if(_fftPoints != rhs->GetNumFFTPoints()) {
+ _fftPoints = rhs->GetNumFFTPoints();
+ delete[] _spectrumData;
+ _spectrumData = new double[_fftPoints * _historyLength];
+ }
+#endif
+
Reset();
SetSpectrumDataBuffer(rhs->GetSpectrumDataBuffer());
SetNumLinesToUpdate(rhs->GetNumLinesToUpdate());
+
+#if QWT_VERSION < 0x060000
setRange(rhs->range());
+#else
+ setInterval(Qt::XAxis, rhs->interval(Qt::XAxis));
+ setInterval(Qt::YAxis, rhs->interval(Qt::YAxis));
+ setInterval(Qt::ZAxis, rhs->interval(Qt::ZAxis));
+#endif
}
void WaterfallData::ResizeData(const double startFreq,
const double stopFreq,
const uint64_t fftPoints)
{
+#if QWT_VERSION < 0x060000
if((fftPoints != GetNumFFTPoints()) ||
(boundingRect().width() != (stopFreq - startFreq)) ||
(boundingRect().left() != startFreq)){
+
+ setBoundingRect(QwtDoubleRect(startFreq, 0,
+ stopFreq-startFreq,
+ boundingRect().height()));
+ _fftPoints = fftPoints;
+ delete[] _spectrumData;
+ _spectrumData = new double[_fftPoints * _historyLength];
+ }
+
+#else
+ if((fftPoints != GetNumFFTPoints()) ||
+ (interval(Qt::XAxis).width() != (stopFreq - startFreq)) ||
+ (interval(Qt::XAxis).minValue() != startFreq)){
+
+ setInterval(Qt::XAxis, QwtInterval(startFreq, stopFreq));
- setBoundingRect(QwtDoubleRect(startFreq, 0, stopFreq-startFreq, boundingRect().height()));
_fftPoints = fftPoints;
delete[] _spectrumData;
_spectrumData = new double[_fftPoints * _historyLength];
}
-
+#endif
+
Reset();
}
QwtRasterData *WaterfallData::copy() const
{
+#if QWT_VERSION < 0x060000
WaterfallData* returnData = new WaterfallData(boundingRect().left(),
boundingRect().right(),
_fftPoints, _historyLength);
+#else
+ WaterfallData* returnData = new WaterfallData(interval(Qt::XAxis).minValue(),
+ interval(Qt::XAxis).maxValue(),
+ _fftPoints, _historyLength);
+#endif
+
returnData->Copy(this);
return returnData;
}
+
+#if QWT_VERSION < 0x060000
QwtDoubleInterval WaterfallData::range() const
{
return _intensityRange;
@@ -84,14 +136,27 @@ void WaterfallData::setRange(const QwtDoubleInterval& newRange)
_intensityRange = newRange;
}
+#endif
+
+
double WaterfallData::value(double x, double y) const
{
double returnValue = 0.0;
-
+
+#if QWT_VERSION < 0x060000
const unsigned int intY = static_cast<unsigned int>((1.0 - (y/boundingRect().height())) *
- static_cast<double>(_historyLength - 1));
+ static_cast<double>(_historyLength-1));
const unsigned int intX = static_cast<unsigned int>((((x - boundingRect().left()) / boundingRect().width()) *
static_cast<double>(_fftPoints-1)) + 0.5);
+#else
+ double height = interval(Qt::YAxis).maxValue();
+ double left = interval(Qt::XAxis).minValue();
+ double right = interval(Qt::XAxis).maxValue();
+ double ylen = static_cast<double>(_historyLength-1);
+ double xlen = static_cast<double>(_fftPoints-1);
+ const unsigned int intY = static_cast<unsigned int>((1.0 - y/height) * ylen);
+ const unsigned int intX = static_cast<unsigned int>((((x - left) / (right-left)) * xlen) + 0.5);
+#endif
const int location = (intY * _fftPoints) + intX;
if((location > -1) && (location < static_cast<int64_t>(_fftPoints * _historyLength))){
@@ -132,7 +197,8 @@ void WaterfallData::addFFTData(const double* fftData,
}
// add the new buffer
- memcpy(&_spectrumData[(_historyLength - 1) * _fftPoints], fftData, _fftPoints*sizeof(double));
+ memcpy(&_spectrumData[(_historyLength - 1) * _fftPoints], fftData,
+ _fftPoints*sizeof(double));
}
}
diff --git a/gr-qtgui/lib/waterfallGlobalData.h b/gr-qtgui/lib/waterfallGlobalData.h
index 51f65064c..89e48da5f 100644
--- a/gr-qtgui/lib/waterfallGlobalData.h
+++ b/gr-qtgui/lib/waterfallGlobalData.h
@@ -4,6 +4,10 @@
#include <qwt_raster_data.h>
#include <inttypes.h>
+#if QWT_VERSION >= 0x060000
+#include <qwt_point_3d.h> // doesn't seem necessary, but is...
+#include <qwt_compat.h>
+#endif
class WaterfallData: public QwtRasterData
{
@@ -17,8 +21,11 @@ public:
virtual void ResizeData(const double, const double, const uint64_t);
virtual QwtRasterData *copy() const;
+
+#if QWT_VERSION < 0x060000
virtual QwtDoubleInterval range() const;
virtual void setRange(const QwtDoubleInterval&);
+#endif
virtual double value(double x, double y) const;
@@ -38,7 +45,12 @@ protected:
uint64_t _fftPoints;
uint64_t _historyLength;
int _numLinesToUpdate;
+
+#if QWT_VERSION < 0x060000
QwtDoubleInterval _intensityRange;
+#else
+ QwtInterval _intensityRange;
+#endif
private:
diff --git a/gr-usrp/apps/Makefile.am b/gr-usrp/apps/Makefile.am
index d014b7c75..b45f3f79c 100644
--- a/gr-usrp/apps/Makefile.am
+++ b/gr-usrp/apps/Makefile.am
@@ -37,7 +37,8 @@ LDADD = \
$(USRP_LA) \
$(GR_USRP_LA) \
$(BOOST_LDFLAGS) \
- $(BOOST_PROGRAM_OPTIONS_LIB)
+ $(BOOST_PROGRAM_OPTIONS_LIB) \
+ $(BOOST_FILESYSTEM_LIB)
noinst_PROGRAMS = \
usrp_rx_cfile \
diff --git a/gr-wxgui/grc/wxgui_fftsink2.xml b/gr-wxgui/grc/wxgui_fftsink2.xml
index 9b35ab848..ec5501838 100644
--- a/gr-wxgui/grc/wxgui_fftsink2.xml
+++ b/gr-wxgui/grc/wxgui_fftsink2.xml
@@ -108,7 +108,7 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
<param>
<name>Ref Level (dB)</name>
<key>ref_level</key>
- <value>50</value>
+ <value>0</value>
<type>real</type>
</param>
<param>
@@ -126,7 +126,7 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
<param>
<name>Refresh Rate</name>
<key>fft_rate</key>
- <value>30</value>
+ <value>15</value>
<type>int</type>
</param>
<param>
diff --git a/gr-wxgui/grc/wxgui_waterfallsink2.xml b/gr-wxgui/grc/wxgui_waterfallsink2.xml
index 7c646c3b2..da6a8a3d1 100644
--- a/gr-wxgui/grc/wxgui_waterfallsink2.xml
+++ b/gr-wxgui/grc/wxgui_waterfallsink2.xml
@@ -80,7 +80,7 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
<param>
<name>Reference Level</name>
<key>ref_level</key>
- <value>50</value>
+ <value>0</value>
<type>real</type>
</param>
<param>
diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am
index a9f9427e9..1ca4bb848 100644
--- a/grc/blocks/Makefile.am
+++ b/grc/blocks/Makefile.am
@@ -183,6 +183,7 @@ dist_ourdata_DATA = \
gr_sub_xx.xml \
gr_threshold_ff.xml \
gr_throttle.xml \
+ gr_transcendental.xml \
gr_uchar_to_float.xml \
gr_udp_sink.xml \
gr_udp_source.xml \
diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml
index f82d40f85..4b864690c 100644
--- a/grc/blocks/block_tree.xml
+++ b/grc/blocks/block_tree.xml
@@ -42,7 +42,7 @@
<block>gr_multiply_xx</block>
<block>gr_divide_xx</block>
<block>gr_nlog10_ff</block>
-
+ <block>gr_transcendental</block>
<block>gr_add_const_vxx</block>
<block>gr_multiply_const_vxx</block>
<block>gr_and_const_xx</block>
diff --git a/grc/blocks/gr_complex_to_float.xml b/grc/blocks/gr_complex_to_float.xml
index 5b02c3d34..05681b0b9 100644
--- a/grc/blocks/gr_complex_to_float.xml
+++ b/grc/blocks/gr_complex_to_float.xml
@@ -23,12 +23,12 @@
<vlen>$vlen</vlen>
</sink>
<source>
- <name>out</name>
+ <name>re</name>
<type>float</type>
<vlen>$vlen</vlen>
</source>
<source>
- <name>out</name>
+ <name>im</name>
<type>float</type>
<vlen>$vlen</vlen>
<optional>1</optional>
diff --git a/grc/blocks/gr_float_to_complex.xml b/grc/blocks/gr_float_to_complex.xml
index a1644efd7..a42cff358 100644
--- a/grc/blocks/gr_float_to_complex.xml
+++ b/grc/blocks/gr_float_to_complex.xml
@@ -18,12 +18,12 @@
</param>
<check>$vlen &gt; 0</check>
<sink>
- <name>in</name>
+ <name>re</name>
<type>float</type>
<vlen>$vlen</vlen>
</sink>
<sink>
- <name>in</name>
+ <name>im</name>
<type>float</type>
<vlen>$vlen</vlen>
<optional>1</optional>
diff --git a/grc/blocks/gr_transcendental.xml b/grc/blocks/gr_transcendental.xml
new file mode 100644
index 000000000..eede447f9
--- /dev/null
+++ b/grc/blocks/gr_transcendental.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##transcendental functions
+###################################################
+ -->
+<block>
+ <name>Transcendental</name>
+ <key>gr_transcendental</key>
+ <import>from gnuradio import gr</import>
+ <make>gr.transcendental($name, "$type")</make>
+ <param>
+ <name>Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Complex</name>
+ <key>complex_double</key>
+ <opt>type:complex</opt>
+ </option>
+ <option>
+ <name>Float</name>
+ <key>float</key>
+ <opt>type:float</opt>
+ </option>
+ </param>
+ <param>
+ <name>Function Name</name>
+ <key>name</key>
+ <value>cos</value>
+ <type>string</type>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>$type.type</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>$type.type</type>
+ </source>
+</block>
diff --git a/grc/python/Block.py b/grc/python/Block.py
index 424706d68..4baf36dc6 100644
--- a/grc/python/Block.py
+++ b/grc/python/Block.py
@@ -75,22 +75,28 @@ class Block(_Block, _GUIBlock):
"""
_Block.rewrite(self)
+ def rectify(ports):
+ #restore integer contiguity after insertion
+ #rectify the port names with the index
+ for i, port in enumerate(ports):
+ port._key = str(i)
+ port._name = port._n['name']
+ if len(ports) > 1: port._name += str(i)
+
def insert_port(get_ports, get_port, key):
prev_port = get_port(str(int(key)-1))
get_ports().insert(
get_ports().index(prev_port)+1,
prev_port.copy(new_key=key),
)
- #restore integer contiguity after insertion
- for i, port in enumerate(get_ports()): port._key = str(i)
+ rectify(get_ports())
def remove_port(get_ports, get_port, key):
port = get_port(key)
for connection in port.get_connections():
self.get_parent().remove_element(connection)
get_ports().remove(port)
- #restore integer contiguity after insertion
- for i, port in enumerate(get_ports()): port._key = str(i)
+ rectify(get_ports())
#adjust nports
for get_ports, get_port in (
diff --git a/grc/python/Connection.py b/grc/python/Connection.py
index 39f915740..218baf074 100644
--- a/grc/python/Connection.py
+++ b/grc/python/Connection.py
@@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
+import Constants
+from .. base.Element import Element
from .. base.Connection import Connection as _Connection
from .. gui.Connection import Connection as _GUIConnection
@@ -32,11 +34,10 @@ class Connection(_Connection, _GUIConnection):
def validate(self):
"""
Validate the connections.
- The ports must match in type and vector length.
+ The ports must match in io size.
"""
- _Connection.validate(self) #checks type
- #check vector length
- source_vlen = self.get_source().get_vlen()
- sink_vlen = self.get_sink().get_vlen()
- if source_vlen != sink_vlen:
- self.add_error_message('Source vector length "%s" does not match sink vector length "%s".'%(source_vlen, sink_vlen))
+ Element.validate(self)
+ source_size = Constants.TYPE_TO_SIZEOF[self.get_source().get_type()] * self.get_source().get_vlen()
+ sink_size = Constants.TYPE_TO_SIZEOF[self.get_sink().get_type()] * self.get_sink().get_vlen()
+ if source_size != sink_size:
+ self.add_error_message('Source IO size "%s" does not match sink IO size "%s".'%(source_size, sink_size))
diff --git a/grc/python/Constants.py b/grc/python/Constants.py
index 868c822aa..ab547ea27 100644
--- a/grc/python/Constants.py
+++ b/grc/python/Constants.py
@@ -45,6 +45,40 @@ FLOW_GRAPH_TEMPLATE = os.path.join(DATA_DIR, 'flow_graph.tmpl')
BLOCK_DTD = os.path.join(DATA_DIR, 'block.dtd')
DEFAULT_FLOW_GRAPH = os.path.join(DATA_DIR, 'default_flow_graph.grc')
+CORE_TYPES = ( #name, key, sizeof, color
+ ('Complex Float 64', 'fc64', 16, '#CC8C69'),
+ ('Complex Float 32', 'fc32', 8, '#3399FF'),
+ ('Complex Integer 64', 'sc64', 16, '#66CC00'),
+ ('Complex Integer 32', 'sc32', 8, '#33cc66'),
+ ('Complex Integer 16', 'sc16', 4, '#cccc00'),
+ ('Complex Integer 8', 'sc8', 2, '#cc00cc'),
+ ('Float 64', 'f64', 8, '#66CCCC'),
+ ('Float 32', 'f32', 4, '#FF8C69'),
+ ('Integer 64', 's64', 8, '#99FF33'),
+ ('Integer 32', 's32', 4, '#00FF99'),
+ ('Integer 16', 's16', 2, '#FFFF66'),
+ ('Integer 8', 's8', 1, '#FF66FF'),
+ ('Message Queue', 'msg', 0, '#777777'),
+ ('Wildcard', '', 0, '#FFFFFF'),
+)
+
+ALIAS_TYPES = {
+ 'complex' : (8, '#3399FF'),
+ 'float' : (4, '#FF8C69'),
+ 'int' : (4, '#00FF99'),
+ 'short' : (2, '#FFFF66'),
+ 'byte' : (1, '#FF66FF'),
+}
+
+TYPE_TO_COLOR = dict()
+TYPE_TO_SIZEOF = dict()
+for name, key, sizeof, color in CORE_TYPES:
+ TYPE_TO_COLOR[key] = color
+ TYPE_TO_SIZEOF[key] = sizeof
+for key, (sizeof, color) in ALIAS_TYPES.iteritems():
+ TYPE_TO_COLOR[key] = color
+ TYPE_TO_SIZEOF[key] = sizeof
+
#coloring
COMPLEX_COLOR_SPEC = '#3399FF'
FLOAT_COLOR_SPEC = '#FF8C69'
diff --git a/grc/python/Platform.py b/grc/python/Platform.py
index a9c2b18ad..e036361ff 100644
--- a/grc/python/Platform.py
+++ b/grc/python/Platform.py
@@ -32,20 +32,7 @@ from Constants import \
DEFAULT_FLOW_GRAPH, BLOCKS_DIRS
import Constants
-COLORS = (#title, #color spec
- ('Complex', Constants.COMPLEX_COLOR_SPEC),
- ('Float', Constants.FLOAT_COLOR_SPEC),
- ('Integer', Constants.INT_COLOR_SPEC),
- ('Short', Constants.SHORT_COLOR_SPEC),
- ('Byte', Constants.BYTE_COLOR_SPEC),
- ('Complex Vector', Constants.COMPLEX_VECTOR_COLOR_SPEC),
- ('Float Vector', Constants.FLOAT_VECTOR_COLOR_SPEC),
- ('Integer Vector', Constants.INT_VECTOR_COLOR_SPEC),
- ('Short Vector', Constants.SHORT_VECTOR_COLOR_SPEC),
- ('Byte Vector', Constants.BYTE_VECTOR_COLOR_SPEC),
- ('Wildcard', Constants.WILDCARD_COLOR_SPEC),
- ('Message', Constants.MSG_COLOR_SPEC),
-)
+COLORS = [(name, color) for name, key, sizeof, color in Constants.CORE_TYPES]
class Platform(_Platform, _GUIPlatform):
diff --git a/grc/python/Port.py b/grc/python/Port.py
index 3846b0f4e..c2bfd9ccc 100644
--- a/grc/python/Port.py
+++ b/grc/python/Port.py
@@ -79,7 +79,7 @@ class Port(_Port, _GUIPort):
self._vlen = n.find('vlen') or ''
self._optional = bool(n.find('optional'))
- def get_types(self): return ('complex', 'float', 'int', 'short', 'byte', 'msg', '')
+ def get_types(self): return Constants.TYPE_TO_SIZEOF.keys()
def validate(self):
_Port.validate(self)
@@ -146,22 +146,18 @@ class Port(_Port, _GUIPort):
@return a hex color code.
"""
try:
- if self.get_vlen() == 1:
- return {#vlen is 1
- 'complex': Constants.COMPLEX_COLOR_SPEC,
- 'float': Constants.FLOAT_COLOR_SPEC,
- 'int': Constants.INT_COLOR_SPEC,
- 'short': Constants.SHORT_COLOR_SPEC,
- 'byte': Constants.BYTE_COLOR_SPEC,
- 'msg': Constants.MSG_COLOR_SPEC,
- }[self.get_type()]
- return {#vlen is non 1
- 'complex': Constants.COMPLEX_VECTOR_COLOR_SPEC,
- 'float': Constants.FLOAT_VECTOR_COLOR_SPEC,
- 'int': Constants.INT_VECTOR_COLOR_SPEC,
- 'short': Constants.SHORT_VECTOR_COLOR_SPEC,
- 'byte': Constants.BYTE_VECTOR_COLOR_SPEC,
- }[self.get_type()]
+ color = Constants.TYPE_TO_COLOR[self.get_type()]
+ vlen = self.get_vlen()
+ if vlen == 1: return color
+ color_val = int(color[1:], 16)
+ r = (color_val >> 16) & 0xff
+ g = (color_val >> 8) & 0xff
+ b = (color_val >> 0) & 0xff
+ dark = (0, 0, 30, 50, 70)[min(4, vlen)]
+ r = max(r-dark, 0)
+ g = max(g-dark, 0)
+ b = max(b-dark, 0)
+ return '#%.2x%.2x%.2x'%(r, g, b)
except: return _Port.get_color(self)
def copy(self, new_key=None):
diff --git a/volk/config/ax_boost_base.m4 b/volk/config/ax_boost_base.m4
index e9790227e..f2a7f6e83 100644
--- a/volk/config/ax_boost_base.m4
+++ b/volk/config/ax_boost_base.m4
@@ -276,7 +276,7 @@ AC_DEFUN([_AX_BOOST_CHECK_LIB_],[
dnl $1 is unit name. E.g., boost_thread
AC_DEFUN([_AX_BOOST_WITH],[
- _AX_BOOST_WITH_($1,m4_bpatsubst($1,_,-))
+ _AX_BOOST_WITH_([$1], [m4_bpatsubst($1,_,-)])
])
dnl $1 is unit name. E.g., boost_thread
@@ -305,7 +305,7 @@ dnl $2 is AC_LANG_PROGRAM argument 1
dnl $3 is AC_LANG_PROGRAM argument 2
dnl $4 is cv variable name. E.g., ax_cv_boost_thread
AC_DEFUN([_AX_BOOST_CHECK_],[
- _AX_BOOST_WITH($1)
+ _AX_BOOST_WITH([$1])
if test "$want_boost" = "yes"; then
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_CXX])
@@ -315,9 +315,9 @@ AC_DEFUN([_AX_BOOST_CHECK_],[
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
AC_CACHE_CHECK([whether the boost::m4_substr([$1],6) includes are available], [$4],
[AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([$2],[$3]),[$4]=yes,[$4]=no)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$2],[$3])], [[$4]=yes], [[$4]=no])
AC_LANG_POP([C++])
- ])
+ ])
if test "$[$4]" = "yes"; then
_AX_BOOST_CHECK_LIB([$1])
fi
@@ -330,5 +330,5 @@ dnl $1 is unit name. E.g., boost_thread
dnl $2 is AC_LANG_PROGRAM argument 1
dnl $3 is AC_LANG_PROGRAM argument 2
AC_DEFUN([_AX_BOOST_CHECK],[
- _AX_BOOST_CHECK_($1,$2,$3,ax_cv_$1)
+ _AX_BOOST_CHECK_([$1], [$2], [$3], [ax_cv_$1])
])