01-20-2020 04:59 AM
Hello I would like to make several control elements visible and invisible at once and wanted to ask if you can bundle them into a property node?
My Masterplan is to change the Frontpanal Completely .
01-20-2020 05:04 AM - edited 01-20-2020 05:06 AM
01-20-2020 05:13 AM
You can't. Possible alternatives:
a) create references from the controls and make arrays from them: you will be able to set properties in a loop
b) group your controls in clusters
01-20-2020 06:35 AM
@cbutcher wrote:
You could build an array and then autoindex through a For loop over all of them.
I used to do this all the time (I haven't done any GUI intensive applications for awhile). It is definitely the way to go for the situation.
01-20-2020 06:43 AM
Thats not realy nice
because the elements don't disappear at the same time
01-20-2020 06:54 AM - edited 01-20-2020 06:55 AM
@fsteini wrote:
Thats not realy nice
because the elements don't disappear at the same time
Depending on the complexity of your GUI, it will look like the same time. To really make sure, you can set the Defer Front Panel property to freeze the front panel before the loop and then unset it after the loop to make the front panel update. Then all of the updates (values, properties) will draw at the same time.
01-20-2020 07:15 AM - edited 01-20-2020 07:16 AM
01-20-2020 07:17 AM - edited 01-20-2020 07:20 AM
@fsteini wrote:
Thats not realy nice
because the elements don't disappear at the same time
I didn't see any variation when doing it on my laptop. If you have a lot of elements and a slow computer, then the DeferPanelUpdates property that Crossrulz beat me to is the answer here.
It will also likely make the process faster in general, which could be an additional benefit if you have so many operations/such a slow computer that it is a problem.
Edit: Note I said "see any variation". Of course in principle without the Defer Updates, there is some variation.
Re the property node, create a property node, read the Panel reference value, and then wire that to a second property node and select Defer Panel Updates.
If you wanted to do this from another VI, you can pass a VI reference to the first property node where you get the Panel reference.
01-20-2020 07:49 AM