LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically config/Design GUI?

Hello, All,
 
This sounds at least for me like an crazy idea. What I want to do is to dynamicallly design the front panel at run time like we design the front panel in development stage.
 
First, we design a GUI which includes buttons, slides, strings....
 
Then build it to executable file, for example Test1.exe.
 
Next, when Test1.exe is running, I want to initiate an extra blank frontpage by click one button on the Test1.exe frontpage.
 
Then, I want to drag/copy controls or indicators from Test1 frontpage to this new blank page. All these controls/indicatiors can be resize, color change...
 
Is it possible to do this?
 
Any hints or suggestions will be appreciated, thanks.  
0 Kudos
Message 1 of 10
(4,034 Views)

What do you expect to do will all these controls after you've placed them there. Do you want to have a VI with no code or just a picture?

Anyway, the closest you can get is by using the picture control (examples) but you should note that it is not optimal for this.

Another option is creating "enough" controls, placing them where you can't see them and then using property nodes to control their positions, but you should note that executables do not have the ability to save VIs, so you won't be able to save it.

There are some other potential alternatives, but the real question is what your ultimate goal is.


___________________
Try to take over the world!
Message 2 of 10
(4,020 Views)

I have done this in a number of apps based on the hint provided by JPD in this thread.

http://forums.ni.com/ni/board/message?board.id=170&message.id=24161#M24161

(see reply #11)

other examples of picture control use can be found in this thread.

http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=14&jump=true

 

The pic control was alos featured as one of Darren's Nuggets here.

http://forums.ni.com/ni/board/message?board.id=170&message.id=212920

 

Here is an example of the results.

I hope this helps. If you come up with a better example, please share it with us.

Trying to help,

Ben

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 10
(4,018 Views)
Well, this is like to simulate the Paint application. 
 
The goal is to provide a strategy to let customer dynamically define their own GUI at Run time stage. Simple example, on test1 front page, there may be more than hundred controls (AO, DO channels) and Indicatiors (AI,DI), Now, the customer may want only config some of them on an extra frontpage at run time stage. For example, he only want display AI1, AI4, DO6, AO6, then he can drag/copy these controls/indicators from test1 front page to extra new blank front page. All channels connected to these controls/indicatiors will be kept unchanged.  I hope this will will help to clarify my question. 
 
  
0 Kudos
Message 4 of 10
(4,016 Views)

The app image I shared is customized by the customer to put the indicators (green dots etc) any where they want on the map the control.

The same app is used for many customers and is delivered as an exe.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 10
(4,005 Views)

Sounds to me like what you want is what I described in my second use case (have "enough" controls and change their properties using property nodes).

You will need a state of operations where the front panel is visible and the customer can simply use mouse events to grab the controls and drag them (change their enabled state to 1 so that they can't change their value).
Then, have a floating window which will show you the properties of the control and allow you to change them.
The last thing you need is to be able to save these properties to a file and to load and apply them later. The OpenG Variant Configuration VIs package should help you there (you will need to modify some of the VIs to save properties for a control). Note that some properties can not be written at run time (like the size, which needs to be  controlled through other properties).

Sounds like a nice project, although you might find out that it is a bit more complicated then you expected.

See an example for how to control properties of controls here.


___________________
Try to take over the world!
Message 6 of 10
(4,003 Views)

Let me add....

If it is at all possible to use tst's method, then DO SO!

My approach is not for the faint of heart and will send your head spinning Smiley Tongue before you are done.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 10
(3,997 Views)

Thanks a lot for so many helpful suggestions.

One more question,  is there any way to leave the orginal control there unchanged  when we drag the control to the different position and just create a copy of the original control?

 

 

 

0 Kudos
Message 8 of 10
(3,986 Views)


@michenglaoxu wrote:

One more question,  is there any way to leave the orginal control there unchanged  when we drag the control to the different position and just create a copy of the original control?

What about the code that goes with that control?
I was under the impression that you wanted to take an existing front panel with code and simply change its appearance.


___________________
Try to take over the world!
0 Kudos
Message 9 of 10
(3,976 Views)

Now I see where the limitation is to implment this in LV. 

Propobaly, OO design (C++/JAVA) may work. in LV, it would be more complicate at least now out of my knowledge.

Anyway, thanks agagin, I will keep working on this and may change my idea ( since this is the initial design stage).  

Thanks again for your kindly help.

 

0 Kudos
Message 10 of 10
(3,963 Views)