Hi George, you could go into gnuradio/grc/blocks, change parameter.xml to have
<option>
<name>Boolean</name>
<key>bool</key>
<opt>type:bool</opt>
</option>
and then change grc/core/generator/flow_graph.tmpl and in the
#for $param in $parameters
loop add an if type == "bool": clause that adds a binary option
(something with ..action="store_true", see [1]). great chance to
contribute :) .
Alternatively, just use an int parameter, and use bool(parameter_id)
whereever you need a true or false. You'll have to pass 0 for False, and
any other int for True, then.
Best regards,
Marcus
[1] https://docs.python.org/2/library/optparse.html#standard-option-actions
On 18.07.2017 10:40, George Vardakis wrote:
> Hi all!
>
> I need to give the user the option to pass a boolean parameter when
> executing my script from command line, something like
> '--split-image=True', where split_image is a parameter of a block.
> What is the way to do that from gnuradio without needing to translate
> inside my code the 'True' string to the boolean True? The 'parameter'
> block in gnuradio does not support boolean type as i saw...
>
> Thank you!
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
