LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Jarrod_S.

View Front Panel Clusters as Icons

Status: New

Simple idea: Extend the View as Icon mode for clusters constants on the block diagram to cluster controls on the front panel! Simply right click any cluster and select View as Icon to change it from this to this:

 

Before cluster.png


We all use clusters on our front panels of our subVIs, but as we add and subtract elements from them, they shift around and start to overlap other controls or they slip off screen. Many times the typedef cluster is used in dozens of VIs. I don't have time to go fix up the front panels of all those VIs everytime I add a new element to the typedef!

 

Most of the time the cluster is used in a subVI, and I don't care about being able to see the elements inside it. I would prefer in this case just to see the icon on my front panel. In fact, this is one thing I LOVE about using LabVIEW classes! So why not extend that clean view of subVI front panel controls to clusters as well!

Jarrod S.
National Instruments
32 Comments
fabric
Active Participant
dthor
Active Participant

Sounds like a job for classes Smiley Happy

Jarrod_S.
Active Participant

Don't get me wrong. I love classes. But it would be a LOT of overhead to create a class wrapper for every typedef cluster (along with Accessor VIs for all the fields) just to pretty up the front panel of my subVIs.

Jarrod S.
National Instruments
dthor
Active Participant

I feel the same say Jarrod_S, so instead of making an accessor for all fields, I just make an accessor for the entire cluster and use bundle/unbundle by name in the main code. Alternatively, if you make sure the class is public and doesn't have any relationships, you should be able to just access the class data directly with bundle/unbundle (thus removing the need to even make one accessor).

dthor
Active Participant

Edit to my above comment:

 

I feel the same say Jarrod_S, so instead of making an accessor for all fields, I just make an accessor for the entire cluster and use bundle/unbundle by name in the main code. Alternatively, if you make sure the class is public and doesn't have any relationships, you should be able to just access the class data directly with bundle/unbundle (thus removing the need to even make one accessor). I was incorrect here. But my first point still applies.

AristosQueue (NI)
NI Employee (retired)

Jarrod_S wrote:

> Don't get me wrong. I love classes. But it would be a LOT of overhead to create

> a class wrapper for every typedef cluster (along with Accessor VIs for all the

> fields) just to pretty up the front panel of my subVIs.

 

So don't do it just to pretty up your front panels. If these clusters aren't UI elements, then making them classes is something you should strongly consider for improving your overall code. You speak of adding all the accessors... try adding methods specific to the class that manipulate the data instead of taking fields in and out all the time. You might even find yourself making the roles of your components better defined as a result of a few good encapsulation walls around your data. 😉

 

JackDunaway
Trusted Enthusiast

@AristosQueue (NI) wrote:

You speak of adding all the accessors... try adding methods specific to the class that manipulate the data instead of taking fields in and out all the time.


Agreed! I'd go even further to say that having many accessors in a class is a code smell. (A class with a lot of accessors is an exception, not the rule.)

 

Rather than focusing on giving Typedefs more of the conveniences of LVClasses, let's focus the conversation on giving LVClasses the conveniences of Typedefs! 🙂

Ray.R
Knight of NI

I like it.  It's one of the very few times I would agree to have something shown as as icon on a block diagram, or in this case, the front panel.

shb
Active Participant
Active Participant

Work around: Create a strict type def with a cluster shich does not resize automatically. You can even put an image (like a *.png, *.bmp, ...) over it.

Alex.T
Active Participant

I like this idea, provided that you're only allowed to do this if the Cluster is wired to the Connector Pane.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)