|
From: | Richard Bell |
Subject: | Re: [Discuss-gnuradio] How do I use formatter in QT GUI Label? |
Date: | Tue, 10 May 2016 14:52:38 -0700 |
RichAm I doing something wrong?I also get this error whenever I double click the QT GUI Label in question:Dan and Marcus (from another thread related to this),I'm trying to do what you say, but I get an error when using "{0:.3e}".format in the formatter field. The default value (0) is now formatted properly but it won't ever update and in terminal I get the following error
Exception in thread Thread-8:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/rbell/Documents/pcodes/radio_devel/production/Stream/pcodes_bpsk_stream_FEC_complexDecoder_loopback.py", line 1704, in _ber_probe
self.set_ber(val)
File "/home/rbell/Documents/pcodes/radio_devel/production/Stream/pcodes_bpsk_stream_FEC_complexDecoder_loopback.py", line 2043, in set_ber
self.set_variable_qtgui_label_0(self._variable_qtgui_label_0_formatter(self.ber))
File "/home/rbell/Documents/pcodes/radio_devel/production/Stream/pcodes_bpsk_stream_FEC_complexDecoder_loopback.py", line 2106, in set_variable_qtgui_label_0
Qt.QMetaObject.invokeMethod(self._variable_qtgui_label_0_label, "setText", Qt.Q_ARG("QString", eng_notation.num_to_str(self.variable_qtgui_label_0)))
File "/usr/local/lib/python2.7/dist-packages/gnuradio/eng_notation.py", line 41, in num_to_str
m = abs(n)
TypeError: bad operand type for abs(): 'str'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gnuradio/grc/gui/Param.py", line 72, in _update_gui
Utils.parse_template(TIP_MARKUP_TMPL, param=self.param).strip(),
File "/usr/local/lib/python2.7/dist-packages/gnuradio/grc/gui/Utils.py", line 121, in __call__
return str(template(namespaces=kwargs))
File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
rc = getattr(self, mainMethName)()
File "cheetah_DynamicallyCompiledCheetahTemplate_1462212927_77_69202.py", line 130, in respond
File "cheetah_DynamicallyCompiledCheetahTemplate_1462212927_77_69202.py", line 87, in truncate
IndexError: tuple index out of rangeOn Fri, May 6, 2016 at 5:54 PM, Dan CaJacob <address@hidden> wrote:I am not sure about this, but you may try the standard python formatters. See https://docs.python.org/2/library/string.htmlOn Fri, May 6, 2016 at 5:13 PM Richard Bell <address@hidden> wrote:_______________________________________________RichWhat do I put in the formatter section to make this happen?20.6e-6 or 20.6x10-6, something along these lines.when I want it to display like thisI am displaying a number using QT GUI Label in GRC like this20.6u
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
--Very Respectfully,Dan CaJacob
[Prev in Thread] | Current Thread | [Next in Thread] |