Re: [Discuss-gnuradio] block without work function won't stop

2015-09-02 Thread Marcus Müller
Huh, I'm out of my depth here.
However, yes, every subclass of gr::block automatically has a
pmt::mp("system") message port, that you can use to do such things.

Best regards,
Marcus

On 02.09.2015 14:47, Nemanja Savic wrote:
> Namely,
>
> my workless function block blocks my flowgraph when I call unlock(). I
> made a method where I set d_finished to True, but this doesn't help.
>
> Nemanja
>
> On Wed, Sep 2, 2015 at 2:16 PM, Nemanja Savic  > wrote:
>
> Hello again,
>
> could you please Marcus, or somebody else, give me some hint for
> sending done message to a block's "system" port. Are all blocks by
> default subscribed to system port?
>
> Best,
> Nemanja
>
> On Tue, May 26, 2015 at 2:37 PM, Nemanja Savic  > wrote:
>
> Hi,
>
> thank you Marcus for your fast answer. Well, the problem is
> that nobody ecept scheduler knows when the flowgraph has
> finished, so I don't know who should sent that message to the
> block. This is however not of crucial importance for me.
> Namely I wanted to test some of my custom blocks, and test
> flowgraph necever reached completion, but as soon as message
> accepting dummy block was out everything was fine.
>
> Best,
> Nemanja
>
> On Tue, May 26, 2015 at 2:29 PM, Marcus Müller
> >
> wrote:
>
> Hi Nemanja,
>
> the point is that with message passing, it's not clear
> that your block is ever finished.
> Hence in block.cc, we have a mechanism to retrieve the
> "finishedness" of a pure-message-block.
>
>   bool
>   block::finished()
>   {
> if((detail()->ninputs() != 0) || (detail()->noutputs()
> != 0))
>   return false;
> else
>   return d_finished;
>   }
>
>
> So, you'll have to set the d_finished variable of your
> block; sadly, that's a private one by design (I think
> there are thread-safety reasons this is not directly
> exposed, but I'm not sure -- I'd have to as T[io]m about
> that).
> The proper way to do so is to send your block a message to
> its pmt::mp("system") port, containing pmt::mp("done").
>
>
> Best regards,
> Marcus
>
>
> On 05/26/2015 02:10 PM, Nemanja Savic wrote:
>> Hi all,
>>
>> I have a block that is used only for acepting messages
>> and writing their content into database. The block is
>> written in python and it has no work function, but only
>> constructor and message handler. However when I run my
>> flowgraph it won't finish until I terminate it. When I
>> exclude this block it runs to completion normally.
>> Is there any issue with messages in this case. Should I
>> manually delete messages from the message queue or
>> something like that.
>>
>> Best,
>>
>> -- 
>> Nemanja Savić
>>
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org 
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org 
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>
>
> -- 
> Nemanja Savić
>
>
>
>
> -- 
> Nemanja Savić
>
>
>
>
> -- 
> Nemanja Savić

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] block without work function won't stop

2015-09-02 Thread Nemanja Savic
Hello again,

could you please Marcus, or somebody else, give me some hint for sending
done message to a block's "system" port. Are all blocks by default
subscribed to system port?

Best,
Nemanja

On Tue, May 26, 2015 at 2:37 PM, Nemanja Savic  wrote:

> Hi,
>
> thank you Marcus for your fast answer. Well, the problem is that nobody
> ecept scheduler knows when the flowgraph has finished, so I don't know who
> should sent that message to the block. This is however not of crucial
> importance for me. Namely I wanted to test some of my custom blocks, and
> test flowgraph necever reached completion, but as soon as message accepting
> dummy block was out everything was fine.
>
> Best,
> Nemanja
>
> On Tue, May 26, 2015 at 2:29 PM, Marcus Müller 
> wrote:
>
>> Hi Nemanja,
>>
>> the point is that with message passing, it's not clear that your block is
>> ever finished.
>> Hence in block.cc, we have a mechanism to retrieve the "finishedness" of
>> a pure-message-block.
>>
>>   bool
>>   block::finished()
>>   {
>> if((detail()->ninputs() != 0) || (detail()->noutputs() != 0))
>>   return false;
>> else
>>   return d_finished;
>>   }
>>
>>
>> So, you'll have to set the d_finished variable of your block; sadly,
>> that's a private one by design (I think there are thread-safety reasons
>> this is not directly exposed, but I'm not sure -- I'd have to as T[io]m
>> about that).
>> The proper way to do so is to send your block a message to its
>> pmt::mp("system") port, containing pmt::mp("done").
>>
>>
>> Best regards,
>> Marcus
>>
>>
>> On 05/26/2015 02:10 PM, Nemanja Savic wrote:
>>
>> Hi all,
>>
>> I have a block that is used only for acepting messages and writing their
>> content into database. The block is written in python and it has no work
>> function, but only constructor and message handler. However when I run my
>> flowgraph it won't finish until I terminate it. When I exclude this block
>> it runs to completion normally.
>> Is there any issue with messages in this case. Should I manually delete
>> messages from the message queue or something like that.
>>
>> Best,
>>
>> --
>> Nemanja Savić
>>
>>
>> ___
>> Discuss-gnuradio mailing 
>> listDiscuss-gnuradio@gnu.orghttps://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>>
>>
>> ___
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>>
>
>
> --
> Nemanja Savić
>



-- 
Nemanja Savić
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] block without work function won't stop

2015-09-02 Thread Nemanja Savic
Namely,

my workless function block blocks my flowgraph when I call unlock(). I made
a method where I set d_finished to True, but this doesn't help.

Nemanja

On Wed, Sep 2, 2015 at 2:16 PM, Nemanja Savic  wrote:

> Hello again,
>
> could you please Marcus, or somebody else, give me some hint for sending
> done message to a block's "system" port. Are all blocks by default
> subscribed to system port?
>
> Best,
> Nemanja
>
> On Tue, May 26, 2015 at 2:37 PM, Nemanja Savic  wrote:
>
>> Hi,
>>
>> thank you Marcus for your fast answer. Well, the problem is that nobody
>> ecept scheduler knows when the flowgraph has finished, so I don't know who
>> should sent that message to the block. This is however not of crucial
>> importance for me. Namely I wanted to test some of my custom blocks, and
>> test flowgraph necever reached completion, but as soon as message accepting
>> dummy block was out everything was fine.
>>
>> Best,
>> Nemanja
>>
>> On Tue, May 26, 2015 at 2:29 PM, Marcus Müller 
>> wrote:
>>
>>> Hi Nemanja,
>>>
>>> the point is that with message passing, it's not clear that your block
>>> is ever finished.
>>> Hence in block.cc, we have a mechanism to retrieve the "finishedness" of
>>> a pure-message-block.
>>>
>>>   bool
>>>   block::finished()
>>>   {
>>> if((detail()->ninputs() != 0) || (detail()->noutputs() != 0))
>>>   return false;
>>> else
>>>   return d_finished;
>>>   }
>>>
>>>
>>> So, you'll have to set the d_finished variable of your block; sadly,
>>> that's a private one by design (I think there are thread-safety reasons
>>> this is not directly exposed, but I'm not sure -- I'd have to as T[io]m
>>> about that).
>>> The proper way to do so is to send your block a message to its
>>> pmt::mp("system") port, containing pmt::mp("done").
>>>
>>>
>>> Best regards,
>>> Marcus
>>>
>>>
>>> On 05/26/2015 02:10 PM, Nemanja Savic wrote:
>>>
>>> Hi all,
>>>
>>> I have a block that is used only for acepting messages and writing their
>>> content into database. The block is written in python and it has no work
>>> function, but only constructor and message handler. However when I run my
>>> flowgraph it won't finish until I terminate it. When I exclude this block
>>> it runs to completion normally.
>>> Is there any issue with messages in this case. Should I manually delete
>>> messages from the message queue or something like that.
>>>
>>> Best,
>>>
>>> --
>>> Nemanja Savić
>>>
>>>
>>> ___
>>> Discuss-gnuradio mailing 
>>> listDiscuss-gnuradio@gnu.orghttps://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>>
>>>
>>>
>>> ___
>>> Discuss-gnuradio mailing list
>>> Discuss-gnuradio@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>>
>>>
>>
>>
>> --
>> Nemanja Savić
>>
>
>
>
> --
> Nemanja Savić
>



-- 
Nemanja Savić
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] block without work function won't stop

2015-05-26 Thread Marcus Müller
Hi Nemanja,

the point is that with message passing, it's not clear that your block
is ever finished.
Hence in block.cc, we have a mechanism to retrieve the finishedness of
a pure-message-block.

  bool
  block::finished()
  {
if((detail()-ninputs() != 0) || (detail()-noutputs() != 0))
  return false;
else
  return d_finished;
  }


So, you'll have to set the d_finished variable of your block; sadly,
that's a private one by design (I think there are thread-safety reasons
this is not directly exposed, but I'm not sure -- I'd have to as T[io]m
about that).
The proper way to do so is to send your block a message to its
pmt::mp(system) port, containing pmt::mp(done).


Best regards,
Marcus

On 05/26/2015 02:10 PM, Nemanja Savic wrote:
 Hi all,

 I have a block that is used only for acepting messages and writing
 their content into database. The block is written in python and it has
 no work function, but only constructor and message handler. However
 when I run my flowgraph it won't finish until I terminate it. When I
 exclude this block it runs to completion normally.
 Is there any issue with messages in this case. Should I manually
 delete messages from the message queue or something like that.

 Best,

 -- 
 Nemanja Savić


 ___
 Discuss-gnuradio mailing list
 Discuss-gnuradio@gnu.org
 https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] block without work function won't stop

2015-05-26 Thread Nemanja Savic
Hi,

thank you Marcus for your fast answer. Well, the problem is that nobody
ecept scheduler knows when the flowgraph has finished, so I don't know who
should sent that message to the block. This is however not of crucial
importance for me. Namely I wanted to test some of my custom blocks, and
test flowgraph necever reached completion, but as soon as message accepting
dummy block was out everything was fine.

Best,
Nemanja

On Tue, May 26, 2015 at 2:29 PM, Marcus Müller marcus.muel...@ettus.com
wrote:

  Hi Nemanja,

 the point is that with message passing, it's not clear that your block is
 ever finished.
 Hence in block.cc, we have a mechanism to retrieve the finishedness of a
 pure-message-block.

   bool
   block::finished()
   {
 if((detail()-ninputs() != 0) || (detail()-noutputs() != 0))
   return false;
 else
   return d_finished;
   }


 So, you'll have to set the d_finished variable of your block; sadly,
 that's a private one by design (I think there are thread-safety reasons
 this is not directly exposed, but I'm not sure -- I'd have to as T[io]m
 about that).
 The proper way to do so is to send your block a message to its
 pmt::mp(system) port, containing pmt::mp(done).


 Best regards,
 Marcus


 On 05/26/2015 02:10 PM, Nemanja Savic wrote:

   Hi all,

  I have a block that is used only for acepting messages and writing their
 content into database. The block is written in python and it has no work
 function, but only constructor and message handler. However when I run my
 flowgraph it won't finish until I terminate it. When I exclude this block
 it runs to completion normally.
  Is there any issue with messages in this case. Should I manually delete
 messages from the message queue or something like that.

  Best,

 --
 Nemanja Savić


 ___
 Discuss-gnuradio mailing 
 listDiscuss-gnuradio@gnu.orghttps://lists.gnu.org/mailman/listinfo/discuss-gnuradio



 ___
 Discuss-gnuradio mailing list
 Discuss-gnuradio@gnu.org
 https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




-- 
Nemanja Savić
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio