LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic front panel

Solved!
Go to solution

Hi,
I'm working on a VI that will be used to control a number of RC Quadcopters and cars.
The VI gets the amount of vehicles from tracking tools, and then runs a loop and finds out for each vehicle if it's a quad or a car.
Now that that stage is completed, I want the front panel to display a line of controlls and indicators for each of the vehicles, and have a different line for quads or cars (i.e for quads I need indicators for x, y, z coordinates and a "takeoff" button, while for cars I need indicators for x, y coordinates and a speed limit control).
Is there a way to create the front panel dynamically depending on input?
the best way I found up until now will be using invisible tabs, so I'll have a tab for each number of vehicles containing said number of lines, and then each line would have two tabs (quad/car), and the tabs to display would be picked at runtime.
The problem is that that would require me to set a maximum number of vehicles, and would require a lot of work if I'll introduce a new type of vehicle, so I'd rather have a more modular system.

I would love some fresh ideas about that problem.

Thank you!
Shayelk

0 Kudos
Message 1 of 6
(3,437 Views)

Use arrays of clusters for each of your device type, rather than putting a fixed number of controls/indicators on your FP.  You can display more than one array element and use a scroll bar if there are too many to display.

 

Could you show what you've done?  Maybe I'll see that I'm way off base if I see your work.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 6
(3,419 Views)

Take a look at this: https://decibel.ni.com/content/docs/DOC-23893

 

The "Simple Actor Example", which can be found within the .zip file, seems exactly like the kind of thing that you need.

 

Edit: more resources

NI LabVIEW Virtual User Group: Introduction to Actor Framework: http://www.ni.com/webcast/2551/en/ (Video introduction to AF)

http://ni.com/actorframework (User group and more resources)

0 Kudos
Message 3 of 6
(3,401 Views)

looks great, I'll try it out!
In the example you attached the different controlls are displayed in a number of windows, is there a way of displaying them in a single FP?

 

thank you!

0 Kudos
Message 4 of 6
(3,358 Views)
Solution
Accepted by topic author shayelk

@shayelk wrote:

looks great, I'll try it out!
In the example you attached the different controlls are displayed in a number of windows, is there a way of displaying them in a single FP?

 

thank you!


Yes!

 

Use subpanels. 

 

I'm assuming you are LVOOPing the class "RC Vehicle" with children classes of "RC Car", "RC Plane", "RC Submarine.Yellow"...etc?

 

Just dynamically dispatch the "Control RC vehicle" methods to a subpanel.

 

OK, "JUST" is an oversimplification..... but that is the way I would look into if it was my project.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 6
(3,351 Views)

I'm pretty new to Labview so I didn't think of using classes, but now that you said it it sounds like the right way to go, so I'll certainly try getting there. thanks!

0 Kudos
Message 6 of 6
(3,339 Views)