Move to support gr-iqbalance new namespace / include path

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
standalone
Sylvain Munaut 10 years ago
parent 834de6bc2d
commit 0c9af4b426
  1. 10
      cmake/Modules/FindGnuradioIQBalance.cmake
  2. 14
      lib/source_impl.cc
  3. 8
      lib/source_impl.h

@ -3,12 +3,12 @@ PKG_CHECK_MODULES(PC_GNURADIO_IQBALANCE gnuradio-iqbalance)
FIND_PATH(
GNURADIO_IQBALANCE_INCLUDE_DIRS
NAMES iqbalance_api.h
HINTS $ENV{GNURADIO_IQBALANCE_DIR}/include/iqbalance
NAMES gnuradio/iqbalance/api.h
HINTS $ENV{GNURADIO_IQBALANCE_DIR}/include
${PC_GNURADIO_IQBALANCE_INCLUDEDIR}
${CMAKE_INSTALL_PREFIX}/include/iqbalance
PATHS /usr/local/include/iqbalance
/usr/include/iqbalance
${CMAKE_INSTALL_PREFIX}/include
PATHS /usr/local/include
/usr/include
)
FIND_LIBRARY(

@ -249,8 +249,8 @@ source_impl::source_impl( const std::string &args )
for (size_t i = 0; i < iface->get_num_channels(); i++) {
#ifdef HAVE_IQBALANCE
iqbalance_optimize_c_sptr iq_opt = iqbalance_make_optimize_c( 0 );
iqbalance_fix_cc_sptr iq_fix = iqbalance_make_fix_cc();
gr::iqbalance::optimize_c::sptr iq_opt = gr::iqbalance::optimize_c::make( 0 );
gr::iqbalance::fix_cc::sptr iq_fix = gr::iqbalance::fix_cc::make();
connect(block, i, iq_fix, 0);
connect(iq_fix, 0, self(), channel++);
@ -340,7 +340,7 @@ double source_impl::set_sample_rate(double rate)
BOOST_FOREACH( source_iface *dev, _devs ) {
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++) {
if ( channel < _iq_opt.size() ) {
iqbalance_optimize_c *opt = _iq_opt[channel];
gr::iqbalance::optimize_c *opt = _iq_opt[channel];
if ( opt->period() > 0 ) { /* optimize is enabled */
opt->set_period( dev->get_sample_rate() / 5 );
@ -613,8 +613,8 @@ void source_impl::set_iq_balance_mode( int mode, size_t chan )
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++) {
if ( chan == channel++ ) {
if ( chan < _iq_opt.size() && chan < _iq_fix.size() ) {
iqbalance_optimize_c *opt = _iq_opt[chan];
iqbalance_fix_cc *fix = _iq_fix[chan];
gr::iqbalance::optimize_c *opt = _iq_opt[chan];
gr::iqbalance::fix_cc *fix = _iq_fix[chan];
if ( IQBalanceOff == mode ) {
opt->set_period( 0 );
@ -649,8 +649,8 @@ void source_impl::set_iq_balance( const std::complex<double> &correction, size_t
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++) {
if ( chan == channel++ ) {
if ( chan < _iq_opt.size() && chan < _iq_fix.size() ) {
iqbalance_optimize_c *opt = _iq_opt[chan];
iqbalance_fix_cc *fix = _iq_fix[chan];
gr::iqbalance::optimize_c *opt = _iq_opt[chan];
gr::iqbalance::fix_cc *fix = _iq_fix[chan];
if ( opt->period() == 0 ) { /* automatic optimization desabled */
fix->set_mag( correction.real() );

@ -23,8 +23,8 @@
#include <osmosdr/source.h>
#ifdef HAVE_IQBALANCE
#include <iqbalance_optimize_c.h>
#include <iqbalance_fix_cc.h>
#include <gnuradio/iqbalance/optimize_c.h>
#include <gnuradio/iqbalance/fix_cc.h>
#endif
#include <source_iface.h>
@ -84,8 +84,8 @@ private:
std::map< size_t, double > _bb_gain;
std::map< size_t, std::string > _antenna;
#ifdef HAVE_IQBALANCE
std::vector< iqbalance_fix_cc * > _iq_fix;
std::vector< iqbalance_optimize_c * > _iq_opt;
std::vector< gr::iqbalance::fix_cc * > _iq_fix;
std::vector< gr::iqbalance::optimize_c * > _iq_opt;
std::map< size_t, std::pair<float, float> > _vals;
#endif
std::map< size_t, double > _bandwidth;

Loading…
Cancel
Save