discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Unable to stop the flow graph after calling stop(


From: Miklos Maroti
Subject: Re: [Discuss-gnuradio] Unable to stop the flow graph after calling stop()
Date: Mon, 3 Mar 2014 12:02:46 +0100

Dear Activecat,

Throw an exception. It will kill the application.

Miklos

On Mon, Mar 3, 2014 at 11:57 AM, Activecat <address@hidden> wrote:
> Dear Marcus,
>
> Says, the constructor performed some basic checking on the constructor
> arguments, then had found some fatal error (says, division by zero) and
> decided to ban the flowgraph from being executed.
>
> A workaround is to get the constructor to set a class variable to false,
> says,
>     d_valid = false;
>
> then in the work() it will check this d_valid as follows:
>
>     int work()
>     {
>         if ( ! d_valid )
>            return -1
>         .........
>         .........  (other stuff as usual)
>     }
>
>
> But isn't there a better way to do this ..?
> (to ban the flowgraph from being executed within the constructor)
>
> Please advise, thanks.
>
> Regards,
> Activecat
>
>
>
> On Mon, Mar 3, 2014 at 5:25 PM, Marcus Müller <address@hidden> wrote:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Activecat,
>>
>> the constructor of a block must have been called before the block has
>> been connect()ed; so there's no way a flowgraph is already running
>> when your block's constructor is called.
>>
>> Greetings,
>> Marcus
>>
>> On 03.03.2014 06:53, Activecat wrote:
>> > Dear Sir, Thank you very much.
>> >
>> > What if, we want to stop the flow graph in the constructor of a
>> > block?
>> >
>> > In work() we can just return -1. But in constructor, what value
>> > should be returned, also -1  ?
>> >
>> > Regards, Activecat
>> >
>> >
>> > On Sun, Feb 2, 2014 at 9:05 PM, Martin Braun
>> > <address@hidden> wrote:
>> >
>> >> On 01.02.2014 13:51, Activecat wrote:
>> >>
>> >>> But the function stop() fails to work. The flow graph continue
>> >>> executing infinitely...
>> >>>
>> >>> Question: How to stop the flow graph when this->d_complete ==
>> >>> true ?
>> >>>
>> >>
>> >> Return -1 (or WORK_DONE) in your work() function.
>> >>
>> >> MB
>> >>
>> >>
>> >> _______________________________________________ Discuss-gnuradio
>> >> mailing list address@hidden
>> >> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>> >>
>> >
>> >
>> >
>> > _______________________________________________ Discuss-gnuradio
>> > mailing list address@hidden
>> > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>> >
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>
>> iQEcBAEBAgAGBQJTFEqdAAoJEAFxB7BbsDrLv84H/jghxvQXY6VcZPvRXs1BKmxp
>> Odr8p/ICE9rpcz21M6M0ILxqhKaOp5vlaG/n6UMM2fFU+Cf7RQQkFrVsEBcqUcGg
>> sgYjE+PmTuIbn6xg6mupAJdN1iVsztH+5qU/71SPxJjfwpnJjsJrzzGlQC6JhGIr
>> fPHDG5DLAS11Q8USSFAc5Y7vXI57rskCZ3/Qq1j+dTl5pgNLSzsccb4AmVBy2dCB
>> 7mM1PIxAuTJgaeXbk85BEnhkwdI4HQzOS7phg53ChYIWMKs+WCsjk0weUNMj2VZt
>> rXdd137xZjkfPHyGJ73spjhJ7OHUW8NeQaNxauI8Uf45S6jnNFFx/vzD1EEgIV8=
>> =vI+z
>> -----END PGP SIGNATURE-----
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>



reply via email to

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