LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I had a dream - multiple personalities

Yes, I had this dream: imagine if your front panel could have different look and feels? I would love to have this feature. I'm still on 8.0.2. Does this feature maybe exist in later versions?

 

Here is how I think it would be implemented (just to give you the picture of what I'd like to see):

 - I imagine that each front panel object has a set (let's use Labview lingo, and call it a cluster) of attributes that describe:

    - it's size

    - the type of object (plot, number, file ref, etc)

    - it's parent objects: for example, it's part of MainWindow.OperateTab.PlotsTab.

    - location of origin in nearest parent: x:150, Y:20

    - any other attributes like color, visible, text font, etc.

 - now, imagine that in one instance of the program I'd like the front panel objects positioned and sized one way. But in another instance (maybe "expert" mode) I want the front panel to look and feel differently. This new instance would need all/most of the same front panel objects. But, the attributes of those objects has to be different to describe my new look and feel.

 - so, I imagine an array to hold the different personalities. Each front panel object would have an array of personalities. Each element of the array has a cluster of all of the attributes that describe that front panel object, for a particular personality.

 - then, I can imagine a property node for the front panel that allows you to select the "active" personality. That property node would also be readable so that your code could change based on the active personality.

 

This feature would allow you to have two or more UI personalities, but keep the code in one place so that many code changes are automatically shared by both look and feels.

 

Does this feature exist in later (than 8.0) flavors of Labview? Has anyone else thought of a way to implement this with existing Labview techniques?

0 Kudos
Message 1 of 28
(3,992 Views)

Use a configuration file to save all the attributes and settings.  You could have a different file for each l"ook and feel" instance.  Upon running, retrieve the proper config file, and use its contents to set up the attributes, like front panel position and size, etc.  This is a great idea.  You could have certain controls hide for regular users and appear for advanced users.  You could set background colors to depict user, administrator, power user, etc.

 

- tbob

Inventor of the WORM Global
Message 2 of 28
(3,979 Views)

Hi rmp,

 

most of your wishes are available as property node for each control/indicator. (Well you can't change the type of an object at runtime...)

 

And you can set those properties at runtime - so make your own database of property settings to apply to all objects on the frontpanel. It's a lot of work, but you will find also a lot of examples in the forum and in other places (LAVA, OpenG).

 

Or you just create different frontpanels for each "personality", Mr.Hyde!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 28
(3,975 Views)

Kudos to tbob for the pratical answer.

 

Now for the inpractical.

 

Controls on the Fly

 

 (art work courtesy of Christian Altenbach)

 

is not a trivial task. The last time did one it used more than a 1000 VI's to implement functional controls and indicators. In my case I used a Picture control to make it look real. Everything else had to be coded. And yes it allowed creating new object at run time.

 

Ben 

 

 

Message Edited by Ben on 04-13-2010 02:23 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 28
(3,974 Views)

The fly picture is cool.  I though it was an actual control since it had a switch on its back.  Wouldn't it be cool if it were a control or indicator.  A GIF image where the fly's wings move when the control or indicator was true.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 28
(3,951 Views)

Hi GergW,

 

I thought about this also:

 

"Or you just create different frontpanels for each "personality", Mr.Hyde!"

 

But, of course, right now, you'd have to have different front panel objects for the different personalities. So, the underlying code that handles the objects of one personality would not handle the other personalities. But, it's an interesting idea, if you introduce a new paradigm that is tantalizing close to what Labview does now:

 - we all know about "local variables" that provide multiple instances of the same front panel object.

 - we'd need a similar, but opposite feature of "local objects". This would be multiple front panel instances of the same variable. They are essentially clones or parallel variables. If you set a value in one instance on the front panel, then it automatically gets set in the other front panel instances. 

 - then you could have different personalities on the same front panel. You'd just scroll the window to the geographical area where the proper personality was placed.

 - No additional code would be required if the new personality just has front panel objects in different locations. But, of course that also means that the code wouldn't know which personality changed a variable.

0 Kudos
Message 6 of 28
(3,925 Views)

Ben,

 

Enjoyed the bad pun!

 

 What I would do is build the expert vi, copy it and redo the front panel as the lower level users, then use both (or more) as a subpanel call based on the user login or perhaps the computer name.

0 Kudos
Message 7 of 28
(3,919 Views)

Thanks tbob,

 

"Use a configuration file to save all the attributes and settings.  You could have a different file for each l"ook and feel" instance.  Upon running, retrieve the proper config file, and use its contents to set up the attributes, like front panel position and size, etc."

 

I haven't worked with config files, so I might be looking at this incorrectly. It sounds like you're saying that I could write a VI that:

 - I'd send some reference to the front panel with one of my personalities (that I manually set up).

 - the VI could "sense" all front panel objects

 - the VI could then loop through all front panel objects and read their front panel attributes (including which tab they might reside in)

 - all of the attributes for every front panel object would then be written to a config file

 

Then, I'd set up the front panel for the next personality, and run the same VI to read and write the attributes for these front panel objects.

 

Then, it sounds like you're saying that I could write another VI that:

 - I'd send some reference to the front panel with one of my personalities (that I manually set up).

 - send a reference to a personality config file

 - the VI would sense all of the object attributes in the config file

 - the VI would loop through the objects defined in the config file, and then set the attributes of the front panel objects.

 

If this capability exists, it seems like someone would have already written the two VIs, since they seem pretty general purpose. Am I looking at this correctly?

0 Kudos
Message 8 of 28
(3,916 Views)

tbob

 

Here are are the animated flies!  :smileyhappy:

 

 

 

OFF Flie.gif

 

 

ON Flie.gif

Message 9 of 28
(3,900 Views)

rmp wrote:

Thanks tbob,

 

"Use a configuration file to save all the attributes and settings.  You could have a different file for each l"ook and feel" instance.  Upon running, retrieve the proper config file, and use its contents to set up the attributes, like front panel position and size, etc."

 

I haven't worked with config files, so I might be looking at this incorrectly. It sounds like you're saying that I could write a VI that:

 - I'd send some reference to the front panel with one of my personalities (that I manually set up).

 - the VI could "sense" all front panel objects

 - the VI could then loop through all front panel objects and read their front panel attributes (including which tab they might reside in)

 - all of the attributes for every front panel object would then be written to a config file

 

Then, I'd set up the front panel for the next personality, and run the same VI to read and write the attributes for these front panel objects.

 

Then, it sounds like you're saying that I could write another VI that:

 - I'd send some reference to the front panel with one of my personalities (that I manually set up).

 - send a reference to a personality config file

 - the VI would sense all of the object attributes in the config file

 - the VI would loop through the objects defined in the config file, and then set the attributes of the front panel objects.

 

If this capability exists, it seems like someone would have already written the two VIs, since they seem pretty general purpose. Am I looking at this correctly?


Thats pretty much what you would do.  Config files consist of sections a keys.  You could create a section for each front panel setup.  Then under each section would be keys for the front panel objects or properties.  The key value would hold the actual property value.  You can have the same key names under different sections.  But each section's key values would be different.  For example:

 

[Power User]  - this is a section

EditButton = visible  -  this is a key name and its value

FP.Background = red

etc...

 

[Regular User]

EditButton = hidden

FP.Background = blue

 

Of course these aren't exact key names and values, but I think you can get the idea.  You can write a vi to create the config files or you can type it all in manually (a big pain).  Config files are ordinary text and readable with Notepad.  When you run your main vi, decide which front panel configuration you want, retrieve the key values in that section only, and set the properties.

 

Thanks for the fly dan07.  Now I just have to find some use for it.  Maybe convert it to a holographic image to play a prank at lunch.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 10 of 28
(3,893 Views)