From e301f16bc3532b578f41b311836812857f4ae262 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Fri, 31 May 2019 17:25:12 +0000 Subject: [PATCH] [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 --- gr-jay/python/peak_manager.py | 12 +-- peak_det_eval.grc | 158 +++++++++++++++++++++++++++++++--- 2 files changed, 153 insertions(+), 17 deletions(-) diff --git a/gr-jay/python/peak_manager.py b/gr-jay/python/peak_manager.py index 31c59fe..08ecdce 100644 --- a/gr-jay/python/peak_manager.py +++ b/gr-jay/python/peak_manager.py @@ -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)) diff --git a/peak_det_eval.grc b/peak_det_eval.grc index 5a65852..d3f01a0 100644 --- a/peak_det_eval.grc +++ b/peak_det_eval.grc @@ -1452,7 +1452,7 @@ _coordinate - (896, 828) + (896, 780) _rotation @@ -2108,11 +2108,11 @@ _enabled - 0 + 1 _coordinate - (576, 80) + (1112, 408) _rotation @@ -2149,9 +2149,13 @@ _enabled True + + filterString + "freq_rel_Hz" + _coordinate - (352, 176) + (328, 172) _rotation @@ -2169,6 +2173,10 @@ minoutbuf 0 + + substString + "freq" + jay_message_filter @@ -2188,9 +2196,13 @@ _enabled True + + filterString + freq_rel_Hz + _coordinate - (664, 416) + (664, 412) _rotation @@ -2208,6 +2220,104 @@ minoutbuf 0 + + substString + freq + + + + jay_message_filter + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + filterString + "freq_abs_Hz" + + + _coordinate + (864, 876) + + + _rotation + 0 + + + id + jay_message_filter_0_1 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + substString + "freq" + + + + jay_message_filter + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + filterString + "freq_abs_Hz" + + + _coordinate + (1040, 84) + + + _rotation + 0 + + + id + jay_message_filter_0_1_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + substString + "freq" + jay_peak_detect @@ -2229,7 +2339,7 @@ fcenter - 0 + f_tune comment @@ -2387,7 +2497,7 @@ _coordinate - (360, 232) + (344, 256) _rotation @@ -2430,7 +2540,7 @@ _coordinate - (664, 464) + (664, 496) _rotation @@ -5288,14 +5398,20 @@ freq - jay_message_filter_0 - jay_message_debug_0 + jay_message_filter_0_0 + freq_xlating_fir_filter_xxx_0_0 + out + freq + + + jay_message_filter_0_1 + jay_peak_detect_1_0 out control - jay_message_filter_0_0 - freq_xlating_fir_filter_xxx_0_0 + jay_message_filter_0_1_0 + qtgui_freq_sink_x_0 out freq @@ -5341,12 +5457,30 @@ status in + + jay_peak_manager_0 + jay_message_filter_0_1 + status + in + + + jay_peak_manager_0_0 + jay_message_debug_0 + status + control + jay_peak_manager_0_0 jay_message_filter_0_0 status in + + jay_peak_manager_0_0 + jay_message_filter_0_1_0 + status + in + jay_peak_manager_0_0 jay_squelch_0