discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Load Preset parameters in block


From: Marcus D. Leech
Subject: Re: [Discuss-gnuradio] Load Preset parameters in block
Date: Mon, 20 Jun 2016 15:49:17 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 06/20/2016 03:17 PM, Mark Arlinghaus wrote:
Hi Marcus,

Thank you for your quick response.  Sorry I wasn't clear.  I'm actually talking about GRC construction.  Once the code is running the parameters won't need to be changed.  If we need to change the parameters, stopping the flowgraph is acceptable.  It's really just meant to make the block slightly easier/faster to set up by the user.  I'm hoping that this makes the solution simpler!?

Mark
Defaults for block parameters in GRC are defined in the .xml description of the block, but there's no way to override what ever is in
  the .xml when you first instantiate a block in GRC.



From: Discuss-gnuradio [address@hidden] on behalf of Marcus D. Leech [address@hidden]
Sent: Monday, June 20, 2016 3:09 PM
To: address@hidden
Subject: Re: [Discuss-gnuradio] Load Preset parameters in block

On 06/20/2016 02:15 PM, Mark Arlinghaus wrote:
Hello,

Is there a way to load preset default parameters in a block.  For example, I have a channel model block that takes several parameters, such as the doppler spread, path delays, path gains, doppler spectrum, etc., and I want to have presets that will auto-populate the parameters in the GRC block for pre-defined channel models.  I can make a drop-down menu that has the pre-defined channel models, but I don't know how to change the values that populate in the other parameters.  I would like to do this using the xml file.  Is there a way to put a conditional parameter in the <value> tags that would depend on the setting in the drop down menu (It seems conditionals can be used in the <hide> and <import> tags, but not inside the <value> tags)?  Is there a way to do it using the <opt> tags?  Is there a list of valid options and what they do anywhere?  It seems the <opt> val:XXX <\opt> tags might do it, but I can't seem to get any of them to work. 

Although I could pass in a preset parameter to the C++ function and simply override everything coming from the GUI, I'd rather have it populate the parameters in the block, but still let them be changed.  This way, if someone wanted to load the settings for a "Channel X" preset, except with a different Doppler spread, it could be done easily.  

Note this is a similar problem as posted here:
https://lists.gnu.org/archive/html/discuss-gnuradio/2015-02/msg00016.html, but it doesn't appear the previous question was ever answered.

Thank you in advance for your help.

Mark Arlinghaus


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
It's not clear whether you're talking about *runtime* or during GRC construction.

For runtime, I'd write a little Python module that contains a function for each parameter:

setter_function(configfilename, command-line-parameter, widget-control-value)

You then have logic in the function to determine the priority of what gets returned:

config-->command-line-->widget-control-value

I've done that in the past.




reply via email to

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