summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Csete2011-07-01 11:12:47 -0700
committerJohnathan Corgan2011-07-01 11:12:47 -0700
commit4c503b6ab621cb15724a6f5ddc6f399d945b42bf (patch)
tree41d6948c932dfdbf33b287b77c5416d7cb4c9c28
parent441a3767e05d15e62c519ea66b848b5adb0f4b3a (diff)
downloadgnuradio-4c503b6ab621cb15724a6f5ddc6f399d945b42bf.tar.gz
gnuradio-4c503b6ab621cb15724a6f5ddc6f399d945b42bf.tar.bz2
gnuradio-4c503b6ab621cb15724a6f5ddc6f399d945b42bf.zip
gnuradio-core: add accessors for gain property of quadrature_demod_cf
Date: Tue, 17 May 2011 21:52:02 +0200 Message-ID: <BANLkTikyEo58UT4QYHRRsrQbzSXcxo2T5A@mail.gmail.com> From: Alexandru Csete <oz9aec@gmail.com> To: patch-gnuradio@gnu.org Subject: [Patch-gnuradio] set/get gain for quadrature_demod Greetings, The attached patch adds set/get gain accessors to the quadrature_demod_cf block, inspired by the similar changes to the frequency_modulator block few days ago. Alex
-rw-r--r--gnuradio-core/src/lib/general/gr_quadrature_demod_cf.h2
-rw-r--r--gnuradio-core/src/lib/general/gr_quadrature_demod_cf.i4
-rw-r--r--grc/blocks/gr_quadrature_demod_cf.xml1
3 files changed, 7 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.h b/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.h
index a29acd628..a7b449c0f 100644
--- a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.h
+++ b/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.h
@@ -44,6 +44,8 @@ class gr_quadrature_demod_cf : public gr_sync_block
float d_gain;
public:
+ void set_gain(float gain) { d_gain = gain; }
+ float get_gain() { return d_gain; }
int work (int noutput_items,
gr_vector_const_void_star &input_items,
diff --git a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.i b/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.i
index fbd45dcf8..2591e1085 100644
--- a/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.i
+++ b/gnuradio-core/src/lib/general/gr_quadrature_demod_cf.i
@@ -27,4 +27,8 @@ gr_quadrature_demod_cf_sptr gr_make_quadrature_demod_cf (float gain);
class gr_quadrature_demod_cf : public gr_sync_block
{
gr_quadrature_demod_cf (float gain);
+
+public:
+ void set_gain(float gain) { d_gain = gain; }
+ float get_gain() { return d_gain; }
};
diff --git a/grc/blocks/gr_quadrature_demod_cf.xml b/grc/blocks/gr_quadrature_demod_cf.xml
index a0e630c7e..fad0b3879 100644
--- a/grc/blocks/gr_quadrature_demod_cf.xml
+++ b/grc/blocks/gr_quadrature_demod_cf.xml
@@ -9,6 +9,7 @@
<key>gr_quadrature_demod_cf</key>
<import>from gnuradio import gr</import>
<make>gr.quadrature_demod_cf($gain)</make>
+ <callback>set_gain($gain)</callback>
<param>
<name>Gain</name>
<key>gain</key>