summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-uhd/grc/uhd_simple_sink.xml20
-rw-r--r--gr-uhd/grc/uhd_simple_source.xml20
-rw-r--r--grc/python/Generator.py2
3 files changed, 39 insertions, 3 deletions
diff --git a/gr-uhd/grc/uhd_simple_sink.xml b/gr-uhd/grc/uhd_simple_sink.xml
index fa9e19be7..7971a296b 100644
--- a/gr-uhd/grc/uhd_simple_sink.xml
+++ b/gr-uhd/grc/uhd_simple_sink.xml
@@ -11,9 +11,15 @@
<import>from gnuradio import uhd</import>
<make>uhd.simple_sink($args, uhd.io_type_t.$type.type)
self.$(id).set_samp_rate($samp_rate)
-self.$(id).set_center_freq($center_freq)</make>
+self.$(id).set_center_freq($center_freq)
+self.$(id).set_gain($gain)
+#if $ant()
+self.$(id).set_antenna($antenna)
+#end if</make>
<callback>set_samp_rate($samp_rate)</callback>
<callback>set_center_freq($center_freq)</callback>
+ <callback>set_gain($gain)</callback>
+ <callback>set_antenna($antenna)</callback>
<param>
<name>Input Type</name>
<key>type</key>
@@ -48,6 +54,18 @@ self.$(id).set_center_freq($center_freq)</make>
<key>center_freq</key>
<type>real</type>
</param>
+ <param>
+ <name>Gain (dB)</name>
+ <key>gain</key>
+ <value>0</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Antenna</name>
+ <key>ant</key>
+ <type>string</type>
+ <hide>#if $ant() == '' then 'part' else 'none'#</hide>
+ </param>
<sink>
<name>out</name>
<type>$type</type>
diff --git a/gr-uhd/grc/uhd_simple_source.xml b/gr-uhd/grc/uhd_simple_source.xml
index 7deffeeec..10a2f2c56 100644
--- a/gr-uhd/grc/uhd_simple_source.xml
+++ b/gr-uhd/grc/uhd_simple_source.xml
@@ -11,9 +11,15 @@
<import>from gnuradio import uhd</import>
<make>uhd.simple_source($args, uhd.io_type_t.$type.type)
self.$(id).set_samp_rate($samp_rate)
-self.$(id).set_center_freq($center_freq)</make>
+self.$(id).set_center_freq($center_freq)
+self.$(id).set_gain($gain)
+#if $ant()
+self.$(id).set_antenna($antenna)
+#end if</make>
<callback>set_samp_rate($samp_rate)</callback>
<callback>set_center_freq($center_freq)</callback>
+ <callback>set_gain($gain)</callback>
+ <callback>set_antenna($antenna)</callback>
<param>
<name>Output Type</name>
<key>type</key>
@@ -48,6 +54,18 @@ self.$(id).set_center_freq($center_freq)</make>
<key>center_freq</key>
<type>real</type>
</param>
+ <param>
+ <name>Gain (dB)</name>
+ <key>gain</key>
+ <value>0</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Antenna</name>
+ <key>ant</key>
+ <type>string</type>
+ <hide>#if $ant() == '' then 'part' else 'none'#</hide>
+ </param>
<source>
<name>out</name>
<type>$type</type>
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index acd98ef84..d53802bef 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -58,7 +58,7 @@ class Generator(object):
def write(self):
#do throttle warning
all_keys = ' '.join(map(lambda b: b.get_key(), self._flow_graph.get_enabled_blocks()))
- if ('usrp' not in all_keys) and ('audio' not in all_keys) and ('throttle' not in all_keys) and self._generate_options != 'hb':
+ if ('usrp' not in all_keys) and ('uhd' not in all_keys) and ('audio' not in all_keys) and ('throttle' not in all_keys) and self._generate_options != 'hb':
Messages.send_warning('''\
This flow graph may not have flow control: no audio or usrp blocks found. \
Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')