diff options
author | Josh Morman <jmorman@gnuradio.org> | 2021-11-24 12:39:12 -0500 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-11-24 14:41:53 -0500 |
commit | 29fd7c725d7e155e668351e0b4532145a6df3212 (patch) | |
tree | 16c0c24543c720ba3f495328356ec0540c368ab5 /gr-qtgui/python/qtgui/msgpushbutton.py | |
parent | aa58bb7d9a37212f46af3cb52e39bfdd6e1bdaf6 (diff) |
qtgui: pep8 formatting
Signed-off-by: Josh Morman <jmorman@gnuradio.org>
Diffstat (limited to 'gr-qtgui/python/qtgui/msgpushbutton.py')
-rw-r--r-- | gr-qtgui/python/qtgui/msgpushbutton.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gr-qtgui/python/qtgui/msgpushbutton.py b/gr-qtgui/python/qtgui/msgpushbutton.py index a3ecaf06c5..4865cc1eb9 100644 --- a/gr-qtgui/python/qtgui/msgpushbutton.py +++ b/gr-qtgui/python/qtgui/msgpushbutton.py @@ -13,6 +13,7 @@ from PyQt5 import Qt from gnuradio import gr import pmt + class MsgPushButton(gr.sync_block, Qt.QPushButton): """ This block creates a variable push button that creates a message @@ -20,8 +21,10 @@ class MsgPushButton(gr.sync_block, Qt.QPushButton): the label. You can define both the output message pmt name as well as the value and value type. """ + def __init__(self, lbl, msgName, msgValue, relBackColor, relFontColor): - gr.sync_block.__init__(self, name="MsgPushButton", in_sig=None, out_sig=None) + gr.sync_block.__init__(self, name="MsgPushButton", + in_sig=None, out_sig=None) Qt.QPushButton.__init__(self, lbl) self.lbl = lbl @@ -44,13 +47,13 @@ class MsgPushButton(gr.sync_block, Qt.QPushButton): def onBtnClicked(self, pressed): if type(self.msgValue) == int: self.message_port_pub(pmt.intern("pressed"), - pmt.cons(pmt.intern(self.msgName), pmt.from_long(self.msgValue))) + pmt.cons(pmt.intern(self.msgName), pmt.from_long(self.msgValue))) elif type(self.msgValue) == float: self.message_port_pub(pmt.intern("pressed"), - pmt.cons(pmt.intern(self.msgName), pmt.from_double(self.msgValue))) + pmt.cons(pmt.intern(self.msgName), pmt.from_double(self.msgValue))) elif type(self.msgValue) == str: self.message_port_pub(pmt.intern("pressed"), - pmt.cons(pmt.intern(self.msgName), pmt.intern(self.msgValue))) + pmt.cons(pmt.intern(self.msgName), pmt.intern(self.msgValue))) elif type(self.msgValue) == bool: self.message_port_pub(pmt.intern("pressed"), - pmt.cons(pmt.intern(self.msgName), pmt.from_bool(self.msgValue))) + pmt.cons(pmt.intern(self.msgName), pmt.from_bool(self.msgValue))) |