简体   繁体   English

GNU Radio Companion——在流程图关闭之前记录一条消息

[英]GNU Radio Companion -- logging a message just prior to flowgraph shutdown

I am using GNU Radio's logging functionality in some custom python blocks I've built for a flowgraph.我在为流程图构建的一些自定义 python 块中使用了 GNU Radio 的日志记录功能。 Among other things, the logging methods are useful for recording the (rough) start time of the flowgraph to a log file.除其他外,日志记录方法对于将流图的(粗略)开始时间记录到日志文件中很有用。 I would also like to record the end time of the flowgraph (ie, the rough time I kill the flowgraph in companion) in a log message written to the log file.我还想在写入日志文件的日志消息中记录流程图的结束时间(即我在伴侣中杀死流程图的粗略时间)。 To be clear, I'm looking for a solution that will work when I run the flowgraph from GNU Radio Companion.明确地说,我正在寻找一种解决方案,当我从 GNU Radio Companion 运行流程图时,该解决方案将起作用。 Is there an easy way to do this?是否有捷径可寻?

In GNU Radio blocks, you can overload the stop method to do exactly that, execute code at flow graph stop time.在 GNU Radio 块中,您可以重载stop方法来做到这一点,在流程图停止时间执行代码。

Generally, the "stop" button in GRC is a rather hardcore thing;一般来说,GRC 中的“停止”按钮是一个比较硬核的东西; if you instead have a finishing condition in your flowgraph itself (eg closing of the window if you're using Qt GUI, or finishing of any block), this could be approached from that logical "I should be done" point of view, rather than "someone else tries to kill me".如果您的流程图本身有一个完成条件(例如,如果您使用 Qt GUI 则关闭窗口,或完成任何块),这可以从逻辑“我应该完成”的角度来处理,而不是而不是“别人想杀我”。

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

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