change gain mode argument to 'automatic' for clarity

gr3.6
Dimitri Stolnikov 11 years ago
parent 8748ee2b56
commit 6bef750ac9
  1. 6
      include/osmosdr/osmosdr_source_c.h
  2. 2
      lib/fcd/fcd_source.cc
  3. 2
      lib/fcd/fcd_source.h
  4. 2
      lib/file/file_source_c.cc
  5. 2
      lib/file/file_source_c.h
  6. 8
      lib/osmosdr_source_c_impl.cc
  7. 2
      lib/osmosdr_source_c_impl.h
  8. 6
      lib/osmosdr_src_iface.h
  9. 6
      lib/rtl/rtl_source_c.cc
  10. 2
      lib/rtl/rtl_source_c.h
  11. 6
      lib/rtl_tcp/rtl_tcp_source_c.cc
  12. 2
      lib/rtl_tcp/rtl_tcp_source_c.h
  13. 2
      lib/uhd/uhd_source_c.cc
  14. 2
      lib/uhd/uhd_source_c.h

@ -148,16 +148,16 @@ public:
/*!
* Set the gain mode for the underlying radio hardware.
* This might be supported only for certain hardware types.
* \param mode the gain mode (true means automatic gain mode)
* \param automatic the gain mode (true means automatic gain mode)
* \param chan the channel index 0 to N-1
* \return the actual gain mode
*/
virtual bool set_gain_mode( bool mode, size_t chan = 0 ) = 0;
virtual bool set_gain_mode( bool automatic, size_t chan = 0 ) = 0;
/*!
* Get the gain mode selected for the underlying radio hardware.
* \param chan the channel index 0 to N-1
* \return the actual gain mode
* \return the actual gain mode (true means automatic gain mode)
*/
virtual bool get_gain_mode( size_t chan = 0 ) = 0;

@ -198,7 +198,7 @@ osmosdr::gain_range_t fcd_source::get_gain_range( const std::string & name, size
return get_gain_range( chan );
}
bool fcd_source::set_gain_mode( bool mode, size_t chan )
bool fcd_source::set_gain_mode( bool automatic, size_t chan )
{
return get_gain_mode(chan);
}

@ -65,7 +65,7 @@ public:
std::vector<std::string> get_gain_names( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
bool set_gain_mode( bool mode, size_t chan = 0 );
bool set_gain_mode( bool automatic, size_t chan = 0 );
bool get_gain_mode( size_t chan = 0 );
double set_gain( double gain, size_t chan = 0 );
double set_gain( double gain, const std::string & name, size_t chan = 0 );

@ -172,7 +172,7 @@ osmosdr::gain_range_t file_source_c::get_gain_range( const std::string & name, s
return get_gain_range( chan );
}
bool file_source_c::set_gain_mode( bool mode, size_t chan )
bool file_source_c::set_gain_mode( bool automatic, size_t chan )
{
return get_gain_mode(chan);
}

@ -61,7 +61,7 @@ public:
std::vector<std::string> get_gain_names( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
bool set_gain_mode( bool mode, size_t chan = 0 );
bool set_gain_mode( bool automatic, size_t chan = 0 );
bool get_gain_mode( size_t chan = 0 );
double set_gain( double gain, size_t chan = 0 );
double set_gain( double gain, const std::string & name, size_t chan = 0 );

@ -316,15 +316,15 @@ osmosdr::gain_range_t osmosdr_source_c_impl::get_gain_range( const std::string &
return osmosdr::gain_range_t();
}
bool osmosdr_source_c_impl::set_gain_mode( bool mode, size_t chan )
bool osmosdr_source_c_impl::set_gain_mode( bool automatic, size_t chan )
{
size_t channel = 0;
BOOST_FOREACH( osmosdr_src_iface *dev, _devs )
for (size_t dev_chan = 0; dev_chan < dev->get_num_channels(); dev_chan++)
if ( chan == channel++ )
if ( _gain_mode[ chan ] != mode ) {
_gain_mode[ chan ] = mode;
return dev->set_gain_mode( mode, dev_chan );
if ( _gain_mode[ chan ] != automatic ) {
_gain_mode[ chan ] = automatic;
return dev->set_gain_mode( automatic, dev_chan );
}
return false;

@ -45,7 +45,7 @@ public:
std::vector<std::string> get_gain_names( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
bool set_gain_mode( bool mode, size_t chan = 0 );
bool set_gain_mode( bool automatic, size_t chan = 0 );
bool get_gain_mode( size_t chan = 0 );
double set_gain( double gain, size_t chan = 0 );
double set_gain( double gain, const std::string & name, size_t chan = 0 );

@ -126,16 +126,16 @@ public:
/*!
* Set the gain mode for the underlying radio hardware.
* This might be supported only for certain hardware types.
* \param mode the gain mode (true means automatic gain mode)
* \param automatic the gain mode (true means automatic gain mode)
* \param chan the channel index 0 to N-1
* \return the actual gain mode
*/
virtual bool set_gain_mode( bool mode, size_t chan = 0 ) = 0;
virtual bool set_gain_mode( bool automatic, size_t chan = 0 ) = 0;
/*!
* Get the gain mode selected for the underlying radio hardware.
* \param chan the channel index 0 to N-1
* \return the actual gain mode
* \return the actual gain mode (true means automatic gain mode)
*/
virtual bool get_gain_mode( size_t chan = 0 ) = 0;

@ -427,11 +427,11 @@ osmosdr::gain_range_t rtl_source_c::get_gain_range( const std::string & name, si
return get_gain_range( chan );
}
bool rtl_source_c::set_gain_mode( bool mode, size_t chan )
bool rtl_source_c::set_gain_mode( bool automatic, size_t chan )
{
if (_dev) {
if (!rtlsdr_set_tuner_gain_mode(_dev, int(!mode))) {
_auto_gain = mode;
if (!rtlsdr_set_tuner_gain_mode(_dev, int(!automatic))) {
_auto_gain = automatic;
}
}

@ -100,7 +100,7 @@ public:
std::vector<std::string> get_gain_names( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
bool set_gain_mode( bool mode, size_t chan = 0 );
bool set_gain_mode( bool automatic, size_t chan = 0 );
bool get_gain_mode( size_t chan = 0 );
double set_gain( double gain, size_t chan = 0 );
double set_gain( double gain, const std::string & name, size_t chan = 0 );

@ -217,11 +217,11 @@ osmosdr::gain_range_t rtl_tcp_source_c::get_gain_range( const std::string & name
return get_gain_range( chan );
}
bool rtl_tcp_source_c::set_gain_mode( bool mode, size_t chan )
bool rtl_tcp_source_c::set_gain_mode( bool automatic, size_t chan )
{
_src->set_gain_mode(int(!mode));
_src->set_gain_mode(int(!automatic));
_auto_gain = mode;
_auto_gain = automatic;
return get_gain_mode(chan);
}

@ -63,7 +63,7 @@ public:
std::vector<std::string> get_gain_names( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
bool set_gain_mode( bool mode, size_t chan = 0 );
bool set_gain_mode( bool automatic, size_t chan = 0 );
bool get_gain_mode( size_t chan = 0 );
double set_gain( double gain, size_t chan = 0 );
double set_gain( double gain, const std::string & name, size_t chan = 0 );

@ -184,7 +184,7 @@ osmosdr::gain_range_t uhd_source_c::get_gain_range( const std::string & name, si
return range;
}
bool uhd_source_c::set_gain_mode( bool mode, size_t chan )
bool uhd_source_c::set_gain_mode( bool automatic, size_t chan )
{
return get_gain_mode(chan);
}

@ -65,7 +65,7 @@ public:
std::vector<std::string> get_gain_names( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( size_t chan = 0 );
osmosdr::gain_range_t get_gain_range( const std::string & name, size_t chan = 0 );
bool set_gain_mode( bool mode, size_t chan = 0 );
bool set_gain_mode( bool automatic, size_t chan = 0 );
bool get_gain_mode( size_t chan = 0 );
double set_gain( double gain, size_t chan = 0 );
double set_gain( double gain, const std::string & name, size_t chan = 0 );

Loading…
Cancel
Save