]> git.gag.com Git - debian/gnuradio/commitdiff
gnuradio-core: export missing public methods in gr.agc2
authorAlexandru Csete <oz9aec@googlemail.com>
Thu, 22 Jul 2010 01:27:46 +0000 (18:27 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Thu, 22 Jul 2010 01:27:46 +0000 (18:27 -0700)
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.

gnuradio-core/src/lib/general/gri_agc2_cc.i
gnuradio-core/src/lib/general/gri_agc2_ff.i
grc/blocks/gr_agc2_xx.xml

index e7d6da97f3b96f2b4a42d97bb70fdf4a2a74622c..0f97f1d8e3799f2775932d5898bed9c27a44867d 100644 (file)
@@ -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);
   };
index 3825ce225a1b29e756585ca7142cd8aa640443cd..d04b638a6edee55bbe87568108652ef5fce7740f 100644 (file)
@@ -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);
   };
index fb3ae57042dbe939ac4718eb74619218eae79552..55b20d4e82db2b051c5c673ba03731ad47c58ebb 100644 (file)
@@ -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>