06-06-2016 12:11 PM
Hey guys,
So my problem is that I have a list of known selections that I would like in something like an enum or ring control, the user will have to click on one option and something will happen unique to each selection. the program will have many pages where the enum/ring will be present and on each page the options available will be a relatively unique grouping of the known values.
basically options 1 - 6 are already known to exist.
on page 1 the drop down shows options 1, 2, 3
on page 2 the drop down shows options 2, 4, 5, 6
....
every page will have some combination of the options.
also this isnt random, im pulling the page and the list of items for the list from a database.
Im trying to think of a good way to do this, my guess is my options are rings or enums but if theres something else I could use to generate lists like this at run time I have no problem looking into it. I was looking into using the strings property node to take the strings of options from the database and populating the ring control but how do I keep the value of the ring always associated with the proper string? I could use the value and string property and just pre associate the database strings with the proper numeric value.
I'm just wondering if there's a better way to go about this.
Thanks for any help
Solved! Go to Solution.
06-06-2016 12:14 PM
I would use a Ring since you need to change the list dynamically. Then you can use the StringsAndValues[] property for each one to populate their individual list.
06-06-2016 12:16 PM
Yeah thats pretty much what I was thinking I would have to do, just looking to see if anyone had a fancy alternative.
Thanks though
02-15-2017 02:21 PM
I also believe TextRing is the answer.
I made a little program comparing TextRing, MenuRing, Enum & Combobox.
The TextRing looks OK to me. The others are either silly or cannot be used like the ENUM
(Why is the ENUM different? Though it looks te same as the TextRing)
02-15-2017 02:35 PM - edited 02-15-2017 02:35 PM
@LV_Warrior wrote:
...
(Why is the ENUM different? Though it looks te same as the TextRing)
Go to the block diagram, turn on the help window, switch to the wiring tool, float over th enum wire and observe....
The enum has string values in the wire.
Ben
03-06-2017 04:37 AM
Indeed. That is a difference.
But what I find more intreaging is that the Enum does not allow setting the strings using a property node while the Textring does.
Is the logic behind this that the Enum has "strings IN THE WIRE" ?`
03-06-2017 08:02 AM
Yes.
03-06-2017 08:27 AM
LV_Warrior wrote:Is the logic behind this that the Enum has "strings IN THE WIRE" ?`
For an Enum, the strings are set at development time. This allows for things like showing the string in the case structure.
A Ring is equivalent to an enum except its strings are set at run time. This means you can update the strings on the fly, but you lose some programming self-documentation.
A combo-box is just like a ring, except the data type is a string instead of a numeric.