[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about writing message handling blocks

From: Jeff Long
Subject: Re: Question about writing message handling blocks
Date: Thu, 9 Jul 2020 13:45:26 -0400

The start() function is called by the framework to tell the block to get ready, so it seems normal that this would happen before any messages arrive.

Did you mean to call run() from __init__()? Are you thinking that this runs as a thread? The result here would be that you would do a sequence of point/track/sleep ops, then __init__() would return, then the framework would start running (and would call the block start()), then handle_msg and/or general_work would be called. __init__() should perform initialization then return, and any subsequent work should be done as a result of work/general_work/handle_msg or be done in another thread.

On Thu, Jul 9, 2020 at 12:37 PM Jeff Long <willcode4@gmail.com> wrote:
This is true, message handling is independent of stream handling. You may be able to add state variables to keep things from happening out of order, and _maybe_ you can register the message handler late?

On Thu, Jul 9, 2020 at 12:01 PM Ellie White <elliewhite1420@gmail.com> wrote:
Hey all,

I've got a question about message handling in GNU Radio. I'm working on developing an out of tree module for controlling the Allen Array, and I'm currently working on a set of two blocks which are supposed to interact via messages, control.py and trackscan.py; note that "control" receives the messages and "trackscan" receives them. The code can be found here (please forgive the messiness, I've not had a chance to tidy it up yet): https://github.com/SETIatHCRO/gr-ata/tree/master/python

I'm struggling because I can't seem to figure out why it is that when I put both of these blocks in a flowgraph, connect them, and run it -- the start function for the "control" blockseemingly gets called *before* the message handler function, and thus it acts like the obs_info dictionary is empty. (https://github.com/SETIatHCRO/gr-ata/blob/master/python/control.py#L54)  Does anyone have any advice on this? This is my first time writing message-passing blocks so I am unfamiliar with the process. If I need to clarify any of the above please let me know and I'd be glad to. Thanks so much for your time and help -- I appreciate it!


Ellie White
Co-Director, Open Source Radio Telescopes
Student at Marshall University

reply via email to

[Prev in Thread] Current Thread [Next in Thread]