|
From: | Steven Knudsen |
Subject: | Re: [Discuss-gnuradio] Python Unit Test with message ports - "Could not find port" |
Date: | Wed, 11 Jan 2017 18:21:20 -0700 |
Hi Marcus, You worry me with your “various ways” comment :-/ All I have done is extended the random_pdu from gr-blocks by including a sequence number in the PDU. So, the constructor is where the message ports are registered and is identical to the random_pdu constructor. I’ve attached a snippet (rsp_constructor.snippet) that contains my exact code. My version works the same as the original when run from GRC. I’ve attached a screencap of the simple flowgraph used to verify this. I’ve also attached the generated python. I took the main code from that generated python and added to my unit test and modified only by changing ‘self’ to self.tb’. When I run that code, I get the could not find port error. If I modify that code to connect only the output of the Message Strobe to the print port of the Message Debug, it works. That is, this does not work, self.tb.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.jitc_random_sequenced_pdu_0, 'generate')) # self.tb.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.blocks_message_debug_0, 'print')) self.tb.msg_connect((self.jitc_random_sequenced_pdu_0, 'pdus'), (self.blocks_message_debug_0, 'print')) But this does work # self.tb.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.jitc_random_sequenced_pdu_0, 'generate')) self.tb.msg_connect((self.blocks_message_strobe_0, 'strobe'), (self.blocks_message_debug_0, 'print')) # self.tb.msg_connect((self.jitc_random_sequenced_pdu_0, 'pdus'), (self.blocks_message_debug_0, 'print')) Last observation is that if I replace my random_sequenced_pdu with block’s random_pdu,it all works. So, it’s definitely something with my module. Is something not generated via/by swig maybe? I tried digging into gr-blocks to look for differences, but so far none that I can see. Sorry this is kind of long, but it’s a weird problem, weird because my stuff works fine in GRC!?! regards, and thanks, steven |
msg_connect_block.py
Description: Text Data
rsp_constructor.snippet
Description: Binary data
|
[Prev in Thread] | Current Thread | [Next in Thread] |