LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deftly handling large number of controls

Solved!
Go to solution

My user requirements dictates I have 14 to 28 controls on a total of 7 tabs (2 to 4 controls per tab). Half are simple doubles, the other half are booleans. I'm trying to think of a more elegant way to handle the value changes for these controls than having 14 to 28 separate user events. I've thought of bundling the event handling on each tab, e.g, "Double1, Double2 value change" and then using the control reference and label property to determine which one was changed but this seems clutzy. Wondering if anyone had a better idea or are separate user events the best way to go despite needing 28 of them.

0 Kudos
Message 1 of 4
(2,949 Views)
Solution
Accepted by BillMe
I would build an array of control references and then use the dynamic event terminals of the event structure. See attached example.
Download All
Message 2 of 4
(2,939 Views)
Ah yes, dynamic events. That thing I keep forgetting about. That certainly reduces the user events to a minimum. I'll give it a try. Thanks!
0 Kudos
Message 3 of 4
(2,925 Views)

To me, the idea of collecting control references into an array and then  registering for all of them is more trouble than it's worth, especially when the number is 28.  (for 200, it might be a different story).

 

For one thing, you lose the connection between the event case and the control it's handling.  In your example, your event says "<1> Value changed".  That's not as descriptive as "Flatistrat Termperature: Value Changed".

 

That's a big deal to me, when you come back a year later, or when your colleague takes over, it's just not as clear as it could be, and there is no performance benefit.  We're talking about saving a few minutes of programmer's time, for little benefit.

 

One thing that could be done is to group the controls into clusters, and make the cluster border invisible. Then you can react to a change in the cluster.  Whether that's worth it or not, I can't say. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 4
(2,917 Views)