简体   繁体   中英

How to convert Message to Float in Gnuradio

I have a cpp block that asynchronously produces a message containing a float value. How can I plot or show this value using available Qt GUI blocks. As QT Gui Number Sink and Time Sink require input of type float whereas my block gives output of message type.

The code I am using to send message is as follows:

float my_float_value = 0.982069;

message_port_pub(pmt::mp("out"), pmt::cons(pmt::PMT_NIL, pmt::from_float(my_float_value)));

When I connect Message Debug block, I get following output in console

 ******* MESSAGE DEBUG PRINT ******** (() . 0.982609) ************************************ 

How can I plot this using QT Gui Number Sink or Time Sink ?

您可以使用功能探针块获取浮点值,并使用QT GUI标签在QT GUI时间槽中显示该值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM