Parameter adjustment with the spinner
-
- Posts: 1
- Joined: Fri Mar 14, 2014 3:33 am
Parameter adjustment with the spinner
I had a minor query. The default increment value for any parameter is typically 1 (in the GUI). Is it possible to change that to something else? And is it possible to restrict a certain parameter's value between 2 defined bounds (eg: 0 to 1) so that the parameter can never take a value greater than the upper bound?
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Parameter adjustment with the spinner
Right click on a spinner (the widget with the "up and down arrow pair" that is just to the right of a numeric field), then select the increment size and modality (additive or multiplicative) from the popup menu.Suranjana Gupta wrote:I had a minor query. The default increment value for any parameter is typically 1 (in the GUI). Is it possible to change that to something else?
Use an xvalue statement that applies a function that enforces limits. Example: suppose you want a parameter called param to be limited to the range 0..10. Also, for the sake of this example suppose param's default value should be 5.is it possible to restrict a certain parameter's value between 2 defined bounds (eg: 0 to 1) so that the parameter can never take a value greater than the upper bound?
Code: Select all
MINparam = 0
MAXparam = 10
DEFparam = 5 // default value
// $1 value to be tested
// $2 minimum allowed value
// $3 maximum allowed value
func limit() {
if ($1<$2) return $2
if ($1>$3) return $3
return $1
}
param = DEFparam
xpanel("Enforce Parameter Limits")
xvalue("Parameter value","param", 1,"param = limit(param, MINparam, MAXparam)", 1, 1 )
xpanel(100, 150)