[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/03: analog: add ControlPort interfaces t
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/03: analog: add ControlPort interfaces to frequency_modulator block. |
Date: |
Fri, 12 Feb 2016 19:27:55 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit eec2270fc1d9a5bde7f0a40e44b3a7556b58629a
Author: Tom Rondeau <address@hidden>
Date: Fri Jan 15 16:57:18 2016 -0500
analog: add ControlPort interfaces to frequency_modulator block.
Change cmake file to allow ControlPort even for static library builds.
---
gr-analog/lib/CMakeLists.txt | 11 -----------
gr-analog/lib/frequency_modulator_fc_impl.cc | 22 ++++++++++++++++++++++
gr-analog/lib/frequency_modulator_fc_impl.h | 2 ++
3 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/gr-analog/lib/CMakeLists.txt b/gr-analog/lib/CMakeLists.txt
index 918f894..a75d703 100644
--- a/gr-analog/lib/CMakeLists.txt
+++ b/gr-analog/lib/CMakeLists.txt
@@ -110,17 +110,6 @@ GR_LIBRARY_FOO(gnuradio-analog RUNTIME_COMPONENT
"analog_runtime" DEVEL_COMPONEN
add_dependencies(gnuradio-analog analog_generated_includes
analog_generated_swigs gnuradio-filter)
if(ENABLE_STATIC_LIBS)
- if(ENABLE_GR_CTRLPORT)
- # Remove GR_CTRLPORT set this target's definitions.
- # Makes sure we don't try to use ControlPort stuff in source files
- GET_DIRECTORY_PROPERTY(STATIC_DEFS COMPILE_DEFINITIONS)
- list(REMOVE_ITEM STATIC_DEFS "GR_CTRLPORT")
- SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS "${STATIC_DEFS}")
-
- # readd it to the target since we removed it from the directory-wide list.
- SET_PROPERTY(TARGET gnuradio-analog APPEND PROPERTY COMPILE_DEFINITIONS
"GR_CTRLPORT")
- endif(ENABLE_GR_CTRLPORT)
-
add_library(gnuradio-analog_static STATIC ${analog_sources})
add_dependencies(gnuradio-analog_static
diff --git a/gr-analog/lib/frequency_modulator_fc_impl.cc
b/gr-analog/lib/frequency_modulator_fc_impl.cc
index 812eb8b..56fa0f7 100644
--- a/gr-analog/lib/frequency_modulator_fc_impl.cc
+++ b/gr-analog/lib/frequency_modulator_fc_impl.cc
@@ -76,5 +76,27 @@ namespace gr {
return noutput_items;
}
+ void
+ frequency_modulator_fc_impl::setup_rpc()
+ {
+#ifdef GR_CTRLPORT
+ add_rpc_variable(
+ rpcbasic_sptr(new rpcbasic_register_get<frequency_modulator_fc, float>(
+ alias(), "sensitivity",
+ &frequency_modulator_fc::sensitivity,
+ pmt::mp(-1024.0f), pmt::mp(1024.0f), pmt::mp(0.0f),
+ "", "Sensitivity", RPC_PRIVLVL_MIN,
+ DISPTIME | DISPOPTSTRIP)));
+
+ add_rpc_variable(
+ rpcbasic_sptr(new rpcbasic_register_set<frequency_modulator_fc, float>(
+ alias(), "sensitivity",
+ &frequency_modulator_fc::set_sensitivity,
+ pmt::mp(-1024.0f), pmt::mp(1024.0f), pmt::mp(0.0f),
+ "", "sensitivity",
+ RPC_PRIVLVL_MIN, DISPNULL)));
+#endif /* GR_CTRLPORT */
+
+ }
} /* namespace analog */
} /* namespace gr */
diff --git a/gr-analog/lib/frequency_modulator_fc_impl.h
b/gr-analog/lib/frequency_modulator_fc_impl.h
index 9f5310c..9f595d1 100644
--- a/gr-analog/lib/frequency_modulator_fc_impl.h
+++ b/gr-analog/lib/frequency_modulator_fc_impl.h
@@ -41,6 +41,8 @@ namespace gr {
void set_sensitivity(float sens) { d_sensitivity = sens; }
float sensitivity() const { return d_sensitivity; }
+ void setup_rpc();
+
int work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);