取消
显示结果 
搜索替代 
您的意思是: 

Dynamically combine clusters

Hello,

i have an application in which a user chooses which hardware instruments he likes to use. Then he should be offered the settings clusters of only the instruments he chose.

I had an array of the settings clusters in mind. But since it is not possible to have an array of clusters of different types i need another solution.

(The main application makes use of LV-OOP, but a simpler solution is also appreciated)

 

Example file of how i would like it is attached.

 

Many Thanks

Marvin

0 项奖励
1 条消息(共 13 条)
5,032 次查看

OOP is your simpler way.  Each instrument should be its own object.  Then for each class, you have a configuration dialog VI for setting it up.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 项奖励
2 条消息(共 13 条)
5,000 次查看

Each Instrument is already a class. Each class has a init VI with different inputs (GPIB port, bus, filter, etc.)

As i mentioned before, i want a set of clusters (or someting similar) to show the user all instrument settings at once.

0 项奖励
3 条消息(共 13 条)
4,997 次查看

nollMarvin wrote:

As i mentioned before, i want a set of clusters (or someting similar) to show the user all instrument settings at once.


But in your original post, you said "I have an application in which a user chooses which hardware instruments he likes to use. Then he should be offered the settings clusters of only the instruments he chose."  So present an array of Instruments, choose one, then display the Cluster of Settings specific for that Instrument.  I suppose if you want to compare the settings of Instrument A and Instrument B, you could Choose A, View A Cluster, Reject A, Choose B, View B Cluster, etc. 

 

Bob Schor 

0 项奖励
4 条消息(共 13 条)
4,986 次查看

As my VI shows, the idea is, that the user can select multiple instruments (more than one) at once. So i need to display not one but N clusters.

0 项奖励
5 条消息(共 13 条)
4,983 次查看

Again, you have to do this with OOP.  You can have this display be your initialization VI.

 

What I do for my systems is store all of the settings in a configuration file and use that for setting up my equipment.  OOP makes this simple as it just reads the settings that class type needs.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 项奖励
6 条消息(共 13 条)
4,980 次查看

Since the port and bus configurations change regularly, i don't want to use config files but promt the user each time. 

0 项奖励
7 条消息(共 13 条)
4,946 次查看

@nollMarvin wrote:

Since the port and bus configurations change regularly, i don't want to use config files but promt the user each time. 


There a multiple ways to do this. Biggest problem is lv doesn't do dynamic control creation very well. So you'll have to be creative.

 

A tree control works well. Each class can add there own configuration scalars to the tree, and the user can select tem and change the values.

 

Or each class can return a reference to a vice that the caller shows in a subpanel. You'll need to switch subpanel content as the user select a device. Or make enough subpanel's to fit the maximum nr of devices. The device class can specify the size of the subpanel it needs.

0 项奖励
8 条消息(共 13 条)
4,922 次查看

Thanks for your reply.

I also hab the tree control in mind. But i didn't consider it further because of the different data types.

In my understanding i would have use strings and then parse the data, e.g. a path, from that string. Is there a way around this?

 

If not i might use a subpanel for each device.

0 项奖励
9 条消息(共 13 条)
4,918 次查看

I believe there may be some free toolkits available through VI Package Manager for tree-like data structures.  One is aptly named 'Tree' from NI.  It supports storage of the actual LabVIEW data types within each node of the tree which can make it easier to extract.  It also supports data visualization in a tree control.

0 项奖励
10 条消息(共 13 条)
4,910 次查看