aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-12-20 09:32:56 +0700
committerPiotr Krysik <ptrkrysik@gmail.com>2019-07-18 10:31:26 +0200
commit0d0508aa86a2a92169d358bdd55631a1d905d6ac (patch)
treecaab30b59969e3ee41fc87a79f8e385ca98eb6ed
parentac3fe63badb7e1e81b970d0060a6babf448dafe5 (diff)
trx/radio_if.py: use existing 'dict_toggle_sign' block
-rw-r--r--python/trx/radio_if.py20
1 files changed, 1 insertions, 19 deletions
diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index 85970a9..49e6788 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -38,25 +38,7 @@ from gnuradio import gr
from gnuradio import filter
from gnuradio.filter import firdes
-
-# HACK: should be implemented in C++!
-class dict_toggle_sign(gr.basic_block):
- def __init__(self): # only default arguments here
- gr.basic_block.__init__(self,
- name='Change sign of elts in dict',
- in_sig=[],
- out_sig=[]
- )
- self.message_port_register_in(pmt.intern("dict_in"))
- self.message_port_register_out(pmt.intern("dict_out"))
- self.set_msg_handler(pmt.intern("dict_in"), self.change_sign)
-
- def change_sign(self, msg):
- if pmt.is_dict(msg):
- d = pmt.to_python(msg)
- for key, value in d.items():
- d[key] *= -1
- self.message_port_pub(pmt.intern("dict_out"), pmt.to_pmt(d))
+from dict_toggle_sign import dict_toggle_sign
class radio_if(gr.top_block):
# PHY specific variables