summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Csete2010-07-21 18:27:46 -0700
committerJohnathan Corgan2010-07-21 18:27:46 -0700
commitf7a2b8b09bf8d30534dd2d7546a7300e2f358595 (patch)
tree9ea1eb080075c76af984d7fe2b50907a09c61947
parentfbe9df39e5a815f96215ca344466e4373cd08594 (diff)
downloadgnuradio-f7a2b8b09bf8d30534dd2d7546a7300e2f358595.tar.gz
gnuradio-f7a2b8b09bf8d30534dd2d7546a7300e2f358595.tar.bz2
gnuradio-f7a2b8b09bf8d30534dd2d7546a7300e2f358595.zip
gnuradio-core: export missing public methods in gr.agc2
Alexandru Csete: The gr_agc2 block has public methods to set and get the AGC levels and rates; however, only a few of these interfaces are exported to Python and none of them are available in GRC. The attached patch adds the missing public methods to gri_agc2_cc.i and gri_agc2_ff.i and defines the corresponding callbacks in the gr_agc2_xx.xml GRC block.
-rw-r--r--gnuradio-core/src/lib/general/gri_agc2_cc.i5
-rw-r--r--gnuradio-core/src/lib/general/gri_agc2_ff.i10
-rw-r--r--grc/blocks/gr_agc2_xx.xml5
3 files changed, 20 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/general/gri_agc2_cc.i b/gnuradio-core/src/lib/general/gri_agc2_cc.i
index e7d6da97f..0f97f1d8e 100644
--- a/gnuradio-core/src/lib/general/gri_agc2_cc.i
+++ b/gnuradio-core/src/lib/general/gri_agc2_cc.i
@@ -39,4 +39,9 @@ class gri_agc2_cc {
float reference ();
float gain ();
float max_gain ();
+ void set_decay_rate (float rate);
+ void set_attack_rate (float rate);
+ void set_reference (float reference);
+ void set_gain (float gain);
+ void set_max_gain(float max_gain);
};
diff --git a/gnuradio-core/src/lib/general/gri_agc2_ff.i b/gnuradio-core/src/lib/general/gri_agc2_ff.i
index 3825ce225..d04b638a6 100644
--- a/gnuradio-core/src/lib/general/gri_agc2_ff.i
+++ b/gnuradio-core/src/lib/general/gri_agc2_ff.i
@@ -34,4 +34,14 @@ class gri_agc2_ff {
public:
gri_agc2_ff (float attack_rate = 1e-1, float decay_rate = 1e-2,
float reference = 1.0, float gain = 1.0, float max_gain = 0.0);
+ float attack_rate ();
+ float decay_rate ();
+ float reference ();
+ float gain ();
+ float max_gain ();
+ void set_attack_rate (float rate);
+ void set_decay_rate (float rate);
+ void set_reference (float reference);
+ void set_gain (float gain);
+ void set_max_gain (float max_gain);
};
diff --git a/grc/blocks/gr_agc2_xx.xml b/grc/blocks/gr_agc2_xx.xml
index fb3ae5704..55b20d4e8 100644
--- a/grc/blocks/gr_agc2_xx.xml
+++ b/grc/blocks/gr_agc2_xx.xml
@@ -9,6 +9,11 @@
<key>gr_agc2_xx</key>
<import>from gnuradio import gr</import>
<make>gr.agc2_$(type.fcn)($attack_rate, $decay_rate, $reference, $gain, $max_gain)</make>
+ <callback>set_attack_rate($attack_rate)</callback>
+ <callback>set_decay_rate($decay_rate)</callback>
+ <callback>set_reference($reference)</callback>
+ <callback>set_gain($gain)</callback>
+ <callback>set_max_gain($max_gain)</callback>
<param>
<name>Type</name>
<key>type</key>