[Peak Manager]
- adaptions to new messages from Peak Detector git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@530 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -100,7 +100,7 @@ class peak_manager(gr.basic_block):
|
||||
peakMsg[key_str] = value
|
||||
|
||||
id = peakMsg['id']
|
||||
freq_MHz = peakMsg['freq_Hz']*1e-6
|
||||
freq_MHz = peakMsg['freq_abs_Hz']*1e-6
|
||||
|
||||
peak_key = 'peak' + str(id)
|
||||
peakEntry = self.peak_get(peak_key)
|
||||
@@ -108,20 +108,22 @@ class peak_manager(gr.basic_block):
|
||||
if peakMsg['state'] == 1:
|
||||
if peakEntry is not None:
|
||||
msg_dict = pmt.make_dict()
|
||||
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq"), pmt.from_float(peakMsg['freq_Hz']))
|
||||
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq_rel_Hz"), pmt.from_float(peakMsg['freq_rel_Hz']))
|
||||
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq_abs_Hz"), pmt.from_float(peakMsg['freq_abs_Hz']))
|
||||
msg_dict = pmt.dict_add(msg_dict, pmt.intern("gain"), pmt.from_float(1.0))
|
||||
portname = peakEntry['port_name']
|
||||
self.message_port_pub(pmt.intern(portname), msg_dict)
|
||||
print ("Updated peak #{} at {:0.2f} MHz on port {}".format(id, freq_MHz, portname))
|
||||
print ("Updated peak #{} at {:0.6f} MHz on port {}".format(id, freq_MHz, portname))
|
||||
else:
|
||||
peakEntry = self.peak_add(peak_key, peakMsg)
|
||||
if peakEntry is not None:
|
||||
msg_dict = pmt.make_dict()
|
||||
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq"), pmt.from_float(peakMsg['freq_Hz']))
|
||||
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq_rel_Hz"), pmt.from_float(peakMsg['freq_rel_Hz']))
|
||||
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq_abs_Hz"), pmt.from_float(peakMsg['freq_abs_Hz']))
|
||||
msg_dict = pmt.dict_add(msg_dict, pmt.intern("gain"), pmt.from_float(1.0))
|
||||
portname = peakEntry['port_name']
|
||||
self.message_port_pub(pmt.intern(portname), msg_dict)
|
||||
print ("New peak #{} at {:0.2f} MHz on port {}".format(id, freq_MHz, portname))
|
||||
print ("New peak #{} at {:0.6f} MHz on port {}".format(id, freq_MHz, portname))
|
||||
else:
|
||||
if peakEntry is not None:
|
||||
pair = pmt.cons(pmt.intern("gain"), pmt.from_float(0.0))
|
||||
|
||||
+146
-12
@@ -1452,7 +1452,7 @@
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(896, 828)</value>
|
||||
<value>(896, 780)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
@@ -2108,11 +2108,11 @@
|
||||
</param>
|
||||
<param>
|
||||
<key>_enabled</key>
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(576, 80)</value>
|
||||
<value>(1112, 408)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
@@ -2149,9 +2149,13 @@
|
||||
<key>_enabled</key>
|
||||
<value>True</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>filterString</key>
|
||||
<value>"freq_rel_Hz"</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(352, 176)</value>
|
||||
<value>(328, 172)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
@@ -2169,6 +2173,10 @@
|
||||
<key>minoutbuf</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>substString</key>
|
||||
<value>"freq"</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
<key>jay_message_filter</key>
|
||||
@@ -2188,9 +2196,13 @@
|
||||
<key>_enabled</key>
|
||||
<value>True</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>filterString</key>
|
||||
<value>freq_rel_Hz</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(664, 416)</value>
|
||||
<value>(664, 412)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
@@ -2208,6 +2220,104 @@
|
||||
<key>minoutbuf</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>substString</key>
|
||||
<value>freq</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
<key>jay_message_filter</key>
|
||||
<param>
|
||||
<key>alias</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>comment</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>affinity</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_enabled</key>
|
||||
<value>True</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>filterString</key>
|
||||
<value>"freq_abs_Hz"</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(864, 876)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>id</key>
|
||||
<value>jay_message_filter_0_1</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>maxoutbuf</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>minoutbuf</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>substString</key>
|
||||
<value>"freq"</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
<key>jay_message_filter</key>
|
||||
<param>
|
||||
<key>alias</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>comment</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>affinity</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_enabled</key>
|
||||
<value>True</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>filterString</key>
|
||||
<value>"freq_abs_Hz"</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(1040, 84)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>id</key>
|
||||
<value>jay_message_filter_0_1_0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>maxoutbuf</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>minoutbuf</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>substString</key>
|
||||
<value>"freq"</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
<key>jay_peak_detect</key>
|
||||
@@ -2229,7 +2339,7 @@
|
||||
</param>
|
||||
<param>
|
||||
<key>fcenter</key>
|
||||
<value>0</value>
|
||||
<value>f_tune</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>comment</key>
|
||||
@@ -2387,7 +2497,7 @@
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(360, 232)</value>
|
||||
<value>(344, 256)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
@@ -2430,7 +2540,7 @@
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(664, 464)</value>
|
||||
<value>(664, 496)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
@@ -5288,14 +5398,20 @@
|
||||
<sink_key>freq</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>jay_message_filter_0</source_block_id>
|
||||
<sink_block_id>jay_message_debug_0</sink_block_id>
|
||||
<source_block_id>jay_message_filter_0_0</source_block_id>
|
||||
<sink_block_id>freq_xlating_fir_filter_xxx_0_0</sink_block_id>
|
||||
<source_key>out</source_key>
|
||||
<sink_key>freq</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>jay_message_filter_0_1</source_block_id>
|
||||
<sink_block_id>jay_peak_detect_1_0</sink_block_id>
|
||||
<source_key>out</source_key>
|
||||
<sink_key>control</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>jay_message_filter_0_0</source_block_id>
|
||||
<sink_block_id>freq_xlating_fir_filter_xxx_0_0</sink_block_id>
|
||||
<source_block_id>jay_message_filter_0_1_0</source_block_id>
|
||||
<sink_block_id>qtgui_freq_sink_x_0</sink_block_id>
|
||||
<source_key>out</source_key>
|
||||
<sink_key>freq</sink_key>
|
||||
</connection>
|
||||
@@ -5341,12 +5457,30 @@
|
||||
<source_key>status</source_key>
|
||||
<sink_key>in</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>jay_peak_manager_0</source_block_id>
|
||||
<sink_block_id>jay_message_filter_0_1</sink_block_id>
|
||||
<source_key>status</source_key>
|
||||
<sink_key>in</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>jay_peak_manager_0_0</source_block_id>
|
||||
<sink_block_id>jay_message_debug_0</sink_block_id>
|
||||
<source_key>status</source_key>
|
||||
<sink_key>control</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>jay_peak_manager_0_0</source_block_id>
|
||||
<sink_block_id>jay_message_filter_0_0</sink_block_id>
|
||||
<source_key>status</source_key>
|
||||
<sink_key>in</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>jay_peak_manager_0_0</source_block_id>
|
||||
<sink_block_id>jay_message_filter_0_1_0</sink_block_id>
|
||||
<source_key>status</source_key>
|
||||
<sink_key>in</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>jay_peak_manager_0_0</source_block_id>
|
||||
<sink_block_id>jay_squelch_0</sink_block_id>
|
||||
|
||||
Reference in New Issue
Block a user