简体   繁体   中英

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. 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. 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.

Generally, the "stop" button in GRC is a rather hardcore thing; 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".

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