diff --git a/grc/gen_bladerf_blocks.py b/grc/gen_bladerf_blocks.py index 9257e83d3e663b7c96b72a8c1b9a7ff5403f7d5b..66d0e794941f63678e3cf37d4bc354bb821b2da8 100644 --- a/grc/gen_bladerf_blocks.py +++ b/grc/gen_bladerf_blocks.py @@ -318,8 +318,8 @@ documentation: |- Manual: Keep last estimated correction when switched from Automatic to Manual. Automatic: Periodicallly find the best solution to compensate for image signals. - Gain Mode: - Chooses between the manual (default) and automatic gain mode where appropriate. + AGC: + Chooses between the manual (False) and automatic (True) gain mode where appropriate. To allow manual control of RF/IF gain stages, manual gain mode must be configured. % endif @@ -402,11 +402,9 @@ PARAMS_TMPL = """ - id: gain_mode${n} category: 'Channel ${n}' - label: 'Gain Mode' + label: 'AGC' dtype: bool default: False - options: [False, True] - option_labels: [Manual, Automatic] hide: ${'$'}{'none' if (nchan > ${n}) else 'all'} % endif diff --git a/lib/source_impl.cc b/lib/source_impl.cc index fc53c8ea861005282f21e39bd54de935c39f4a68..0fcf59c0123d24d75f8a1bb3c1565105f5c30168 100644 --- a/lib/source_impl.cc +++ b/lib/source_impl.cc @@ -158,14 +158,7 @@ namespace gr { bool source_impl::set_gain_mode(bool automatic, size_t chan) { - return gain_mode_.set_if_not_equal(automatic,chan,get_num_channels(), - [this, automatic, chan] - { - bool mode = device_->set_gain_mode(automatic,chan); - if(!automatic) - device_->set_gain(gain_[chan], chan); - return mode; - }); + return device_->set_gain_mode(automatic,chan); } bool source_impl::get_gain_mode(size_t chan) diff --git a/lib/source_impl.h b/lib/source_impl.h index 36d4722668b792e674a15566534e6b35a9beddf0..a4b6756a4c335a1c41ed648f2048aa67ec9d9e03 100644 --- a/lib/source_impl.h +++ b/lib/source_impl.h @@ -23,16 +23,12 @@ namespace gr { channel_store<double> center_freq_; channel_store<double> freq_corr_; - channel_store<bool> gain_mode_; channel_store<double> gain_; channel_store<double> if_gain_; channel_store<double> bb_gain_; channel_store<std::string> antenna_; channel_store<double> bandwidth_; - - - public: source_impl(const std::string & args); ~source_impl();