Here's what I am trying to do. I am writting a program that runs a test defined by the user. The test is composed of a list of steps, each of which can take one of N forms, say "power-cycle", "multimeter", and "stimulus-responce". Each of the different step types has different parameters that define what the step does. (The actual steps types are different than this and there are alot more of them, but you get the point).
Now I must have a data structure to hold this info internally and I must provide a GUI for the user to edit this structure to create new custom tests. This is how I would create this data structure for this in C:
struct {
char step_name[MAX_NAME_LEN];
enum {type1, type2, type3} step_type;
union {
struct Type1Def type1;
struct Type2Def type2;
struct Type3Def type3;
} step_def;
} TestDef [MAX_TEST_LEN];
In LabView this translates into: (I moved all the union elements out to the containing struct (cluster) since labview doesn't have a union, and it's only purpose is to save memory)
Test Def (1-D array of)
Step Def (cluster of N+2 elements)
Step Name (string)
Step Type (enum {type1, type2, type3})
Type1 Def (cluster of ???)
Type2 Def (cluster of ???)
Type3 Def (cluster of ???)
It would be great if the data stucture for holding this data could also double as the user interface for manipulating the data - as is normally the case with LabView.
Now onto your comments:
Instead of the "super cluster" with subclusters, could you just use a tab control with a subcluster on each page?"
I would love to do this - but the tab control would need to be inside of an array like I described above, which isn't possible.
I think what I'm going to end up doing is to create the data structure like I explained above, and then create a different front panel for editing the data, where I can slap the substructures into a tab control, and then have another contol on the side the chooses which item in the array the user is refering to.
I hope this explains my problem better. If you know of a better way to do what I'm doing let me know, otherwise don't worry about it. I just figured I'd check and see if upgrading to LabView 7 would solve all my problems, bring world peace, and end all poverty. But I guess I'm just going to have to bite the bullet and get down to work, and live with a few uglies 🙂