From 42faa574651f3d290381672800ba89a8e0bac8dd Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Wed, 29 May 2019 16:42:57 +0000 Subject: [PATCH] - Squelch: added init value git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@511 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- gr-jay/grc/jay_squelch.xml | 9 +++++++-- gr-jay/include/jay/squelch.h | 2 +- gr-jay/lib/squelch_impl.cc | 8 ++++---- gr-jay/lib/squelch_impl.h | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gr-jay/grc/jay_squelch.xml b/gr-jay/grc/jay_squelch.xml index 745312e..e5b50bb 100644 --- a/gr-jay/grc/jay_squelch.xml +++ b/gr-jay/grc/jay_squelch.xml @@ -4,8 +4,13 @@ jay_squelch [jay] import jay - jay.squelch() - + jay.squelch($initValue) + + Initial Value + initValue + 0.0 + float + control message diff --git a/gr-jay/include/jay/squelch.h b/gr-jay/include/jay/squelch.h index 007cb64..523b509 100644 --- a/gr-jay/include/jay/squelch.h +++ b/gr-jay/include/jay/squelch.h @@ -46,7 +46,7 @@ namespace gr { * class. jay::squelch::make is the public interface for * creating new instances. */ - static sptr make(); + static sptr make(float initValue); }; } // namespace jay diff --git a/gr-jay/lib/squelch_impl.cc b/gr-jay/lib/squelch_impl.cc index c3407c9..d9a438e 100644 --- a/gr-jay/lib/squelch_impl.cc +++ b/gr-jay/lib/squelch_impl.cc @@ -30,21 +30,21 @@ namespace gr { namespace jay { squelch::sptr - squelch::make() + squelch::make(float initValue) { return gnuradio::get_initial_sptr - (new squelch_impl()); + (new squelch_impl(initValue)); } /* * The private constructor */ - squelch_impl::squelch_impl() + squelch_impl::squelch_impl(float initValue) : gr::sync_block("squelch", gr::io_signature::make(1, 1, sizeof(float)), gr::io_signature::make(1, 1, sizeof(float))) - , m_gain_target(1.0f) + , m_gain_target(initValue) , m_gain(0.0f) { m_msg_port_in = pmt::mp("control"); diff --git a/gr-jay/lib/squelch_impl.h b/gr-jay/lib/squelch_impl.h index aae431a..68e016b 100644 --- a/gr-jay/lib/squelch_impl.h +++ b/gr-jay/lib/squelch_impl.h @@ -35,7 +35,7 @@ namespace gr { float m_gain; public: - squelch_impl(); + squelch_impl(float initValue); ~squelch_impl(); void print_pair(pmt::pmt_t pair); void on_message(pmt::pmt_t msg);