简体   繁体   English

如何在Gnuradio中将消息转换为Float

[英]How to convert Message to Float in Gnuradio

I have a cpp block that asynchronously produces a message containing a float value. 我有一个cpp块,它异步生成包含浮点值的消息。 How can I plot or show this value using available Qt GUI blocks. 如何使用可用的Qt GUI块绘制或显示此值。 As QT Gui Number Sink and Time Sink require input of type float whereas my block gives output of message type. 由于QT Gui数字接收器和时间接收器要求输入类型为float,而我的块给出了消息类型的输出。

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块时,在控制台中得到以下输出

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

How can I plot this using QT Gui Number Sink or Time Sink ? 如何使用QT Gui Number Sink或Time Sink绘制此图形?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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