diff options
author | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-05-30 17:23:59 +0200 |
---|---|---|
committer | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-05-30 17:23:59 +0200 |
commit | cdb6242848ba3d23a34da41da7a234b1d777629b (patch) | |
tree | 5feb83866ff8ae7abaab13f453d99324ef6376bc /plugins | |
parent | b91228c19ae45b1fd704c010ae514d61c3c6295f (diff) |
gnuradioinput: migrate to gr3.7 version of gr-osmosdr
Diffstat (limited to 'plugins')
7 files changed, 82 insertions, 38 deletions
diff --git a/plugins/samplesource/gnuradio/CMakeLists.txt b/plugins/samplesource/gnuradio/CMakeLists.txt index 36ec01f..74798bc 100644 --- a/plugins/samplesource/gnuradio/CMakeLists.txt +++ b/plugins/samplesource/gnuradio/CMakeLists.txt @@ -1,29 +1,17 @@ project(gnuradio) -find_package(Gruel) -find_package(GnuradioCore) -find_package(GnuradioOsmosdr) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) -SET(BOOST_REQUIRED_COMPONENTS - system -) +find_package(GnuradioRuntime) +find_package(GnuradioOsmosdr) if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64") -set(Boost_ADDITIONAL_VERSIONS - "1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39" - "1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44" - "1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49" - "1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54" - "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59" - "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64" - "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69" -) -find_package(Boost 1.35 COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) +find_package(Boost) -if(Boost_FOUND AND GRUEL_FOUND AND GNURADIO_CORE_FOUND AND GNURADIO_OSMOSDR_FOUND) +if(Boost_FOUND AND GNURADIO_RUNTIME_FOUND AND GNURADIO_OSMOSDR_FOUND) set(gnuradio_SOURCES gnuradiogui.cpp @@ -49,8 +37,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include-gpl ${Boost_INCLUDE_DIRS} - ${GRUEL_INCLUDE_DIRS} - ${GNURADIO_CORE_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ${GNURADIO_OSMOSDR_INCLUDE_DIRS} ) @@ -72,10 +59,9 @@ add_library(inputgnuradio SHARED target_link_libraries(inputgnuradio ${QT_LIBRARIES} ${Boost_LIBRARIES} - ${GRUEL_LIBRARIES} - ${GNURADIO_CORE_LIBRARIES} + ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} sdrbase ) -endif(Boost_FOUND AND GRUEL_FOUND AND GNURADIO_CORE_FOUND AND GNURADIO_OSMOSDR_FOUND) +endif(Boost_FOUND AND GNURADIO_RUNTIME_FOUND AND GNURADIO_OSMOSDR_FOUND) diff --git a/plugins/samplesource/gnuradio/cmake/Modules/FindGnuradioOsmosdr.cmake b/plugins/samplesource/gnuradio/cmake/Modules/FindGnuradioOsmosdr.cmake new file mode 100644 index 0000000..156a38d --- /dev/null +++ b/plugins/samplesource/gnuradio/cmake/Modules/FindGnuradioOsmosdr.cmake @@ -0,0 +1,29 @@ +INCLUDE(FindPkgConfig) +PKG_CHECK_MODULES(PC_GNURADIO_OSMOSDR gnuradio-osmosdr) + +FIND_PATH( + GNURADIO_OSMOSDR_INCLUDE_DIRS + NAMES osmosdr/api.h + HINTS $ENV{GNURADIO_OSMOSDR_DIR}/include + ${PC_GNURADIO_OSMOSDR_INCLUDEDIR} + ${CMAKE_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include +) + +FIND_LIBRARY( + GNURADIO_OSMOSDR_LIBRARIES + NAMES gnuradio-osmosdr + HINTS $ENV{GNURADIO_OSMOSDR_DIR}/lib + ${PC_GNURADIO_OSMOSDR_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib64 + ${CMAKE_INSTALL_PREFIX}/lib + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 +) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_OSMOSDR DEFAULT_MSG GNURADIO_OSMOSDR_LIBRARIES GNURADIO_OSMOSDR_INCLUDE_DIRS) +MARK_AS_ADVANCED(GNURADIO_OSMOSDR_LIBRARIES GNURADIO_OSMOSDR_INCLUDE_DIRS) diff --git a/plugins/samplesource/gnuradio/cmake/Modules/FindGnuradioRuntime.cmake b/plugins/samplesource/gnuradio/cmake/Modules/FindGnuradioRuntime.cmake new file mode 100644 index 0000000..124626e --- /dev/null +++ b/plugins/samplesource/gnuradio/cmake/Modules/FindGnuradioRuntime.cmake @@ -0,0 +1,29 @@ +INCLUDE(FindPkgConfig) +PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime) + +FIND_PATH( + GNURADIO_RUNTIME_INCLUDE_DIRS + NAMES gnuradio/api.h + HINTS $ENV{GNURADIO_RUNTIME_DIR}/include + ${PC_GNURADIO_RUNTIME_INCLUDEDIR} + ${CMAKE_INSTALL_PREFIX}/include + PATHS /usr/local/include + /usr/include +) + +FIND_LIBRARY( + GNURADIO_RUNTIME_LIBRARIES + NAMES gnuradio-runtime + HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib + ${PC_GNURADIO_RUNTIME_LIBDIR} + ${CMAKE_INSTALL_PREFIX}/lib64 + ${CMAKE_INSTALL_PREFIX}/lib + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 +) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_RUNTIME DEFAULT_MSG GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) +MARK_AS_ADVANCED(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) diff --git a/plugins/samplesource/gnuradio/gnuradiogui.cpp b/plugins/samplesource/gnuradio/gnuradiogui.cpp index b393186..bc1965c 100644 --- a/plugins/samplesource/gnuradio/gnuradiogui.cpp +++ b/plugins/samplesource/gnuradio/gnuradiogui.cpp @@ -19,7 +19,7 @@ #include "gnuradiogui.h" #include "ui_gnuradiogui.h" -#include <osmosdr/osmosdr_device.h> +#include <osmosdr/device.h> #include <iostream> #include <plugin/pluginapi.h> diff --git a/plugins/samplesource/gnuradio/gnuradioinput.cpp b/plugins/samplesource/gnuradio/gnuradioinput.cpp index 7219660..17a19de 100644 --- a/plugins/samplesource/gnuradio/gnuradioinput.cpp +++ b/plugins/samplesource/gnuradio/gnuradioinput.cpp @@ -124,7 +124,7 @@ bool GNURadioInput::startInput(int device) applySettings(m_generalSettings, m_settings, true); if(m_GnuradioThread != NULL) { - osmosdr_source_c_sptr radio = m_GnuradioThread->radio(); + osmosdr::source::sptr radio = m_GnuradioThread->radio(); try { osmosdr::freq_range_t freq_rage = radio->get_freq_range(); @@ -246,7 +246,7 @@ bool GNURadioInput::applySettings(const GeneralSettings& generalSettings, if ( NULL == m_GnuradioThread ) return true; - osmosdr_source_c_sptr radio = m_GnuradioThread->radio(); + osmosdr::source::sptr radio = m_GnuradioThread->radio(); try { diff --git a/plugins/samplesource/gnuradio/gnuradiothread.cpp b/plugins/samplesource/gnuradio/gnuradiothread.cpp index f776384..9e70d3e 100644 --- a/plugins/samplesource/gnuradio/gnuradiothread.cpp +++ b/plugins/samplesource/gnuradio/gnuradiothread.cpp @@ -21,8 +21,8 @@ #include "gnuradiothread.h" #include "dsp/samplefifo.h" -#include <gnuradio/gr_sync_block.h> -#include <gnuradio/gr_io_signature.h> +#include <gnuradio/sync_block.h> +#include <gnuradio/io_signature.h> //////////////////////////////////////////////////////////////////////////////// class gr_adaptor; @@ -31,7 +31,7 @@ typedef boost::shared_ptr< gr_adaptor > gr_adaptor_sptr; gr_adaptor_sptr make_gr_adaptor (SampleFifo* sampleFifo); -class gr_adaptor : public gr_sync_block +class gr_adaptor : public gr::sync_block { public: gr_adaptor (SampleFifo* sampleFifo); @@ -52,9 +52,9 @@ make_gr_adaptor (SampleFifo *sampleFifo) } gr_adaptor::gr_adaptor (SampleFifo *sampleFifo) - : gr_sync_block ("gr_adaptor", - gr_make_io_signature (1, 1, sizeof (gr_complex)), - gr_make_io_signature (0, 0, 0)), + : gr::sync_block("gr_adaptor", + gr::io_signature::make(1, 1, sizeof (gr_complex)), + gr::io_signature::make(0, 0, 0)), m_sampleFifo(sampleFifo) { } @@ -127,8 +127,8 @@ void GnuradioThread::stopWork() void GnuradioThread::run() { - m_top = gr_make_top_block( "flowgraph" ); - m_src = osmosdr_make_source_c( m_args.toStdString() ); + m_top = gr::make_top_block( "flowgraph" ); + m_src = osmosdr::source::make( m_args.toStdString() ); /* now since we've constructed our shared objects, we allow the calling * thread to continue it's work and send some radio settings to us. */ diff --git a/plugins/samplesource/gnuradio/gnuradiothread.h b/plugins/samplesource/gnuradio/gnuradiothread.h index 794b857..651238d 100644 --- a/plugins/samplesource/gnuradio/gnuradiothread.h +++ b/plugins/samplesource/gnuradio/gnuradiothread.h @@ -23,8 +23,8 @@ #include <QMutex> #include <QWaitCondition> -#include <gnuradio/gr_top_block.h> -#include <osmosdr/osmosdr_source_c.h> +#include <gnuradio/top_block.h> +#include <osmosdr/source.h> class SampleFifo; @@ -38,7 +38,7 @@ public: void startWork(); void stopWork(); - osmosdr_source_c_sptr radio() { return m_src; } + osmosdr::source::sptr radio() { return m_src; } private: #pragma pack(push, 1) @@ -55,8 +55,8 @@ private: QString m_args; SampleFifo* m_sampleFifo; - gr_top_block_sptr m_top; - osmosdr_source_c_sptr m_src; + gr::top_block_sptr m_top; + osmosdr::source::sptr m_src; void run(); }; |