Fixed set of values as dropdown inputs
Submitted by vinayak on Thu, 01/21/2016 - 23:59
I want to know if there is a way to input pre-selected values as inputs similar to drop down menus. Example> if I want to ensure user can input only one of the pre-selected values e.g., 0,25,50,75,100 , but no other values how can I do it? Secondly> if I want to name these values such as NONE, QUARTER, HALF etc. which when selected will input corresponding numeric value, how can I do this in a model? Thanks, Vinayak
Answers
-
Submitted by pete on Fri, 01/22/2016 - 01:22.
You need to use dialogConstant blocks like this one: . It is under Blocks > Signal Producers.
Right click the block to set it up as a dropdown (integer list):The output of the dialogConstant block will be the ordinal value of the selected item in the list.
The topmost item has value 0.
To transform the list index value to other values, use a case block as below:To see your dialogConstant dropdown along with other dialogConstants in a dialog box, encapsulate all the dialogConstants and associated blocks into a Compound block. Ctrl + right click on the Compound and select 'Create Dialog from Contained Dialog Constants' as below:
When the user right clicks on the compound, The following custom dialog containing all dialogConstant blocks will appear. We added one more dialogConstant block for 'Test Duration'. See below:
If you are signed in, you can download the example diagram used for the above screen shots by clicking the attachment below.
0