LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
PaulLotz

Create a "smart" version of subpanels to simplify creation of composite views

Status: New

A common use case we have is that we have a functional view component (that has behavior) that we want to reuse on a another view.  (For instance, we often want to show behavior from a subsystem view also on a higher-level view.)  It should be the case that we can just insert the functioning, encapsulated view component on any other view and it should work (provided, of course, it will function correctly in the new context, but in the cases I am discussing it will).  In other words, the larger view will be a composite of smaller elements.  (See the Composite design pattern for a related discussion.)

 

Subpanels offer a means to do this, but I suggest they can be simpler to use for this purpose.

 

Currently, using a subpanel this way requires several steps, most notably sizing the subpanel to match the size of the VI we want to insert in it (which is not straightforward).  (Yes, I know we can size the contents of the subpanel to match the size of the subpanel, but we have yet to have a use case for this.)  We also typically write code in the main view VI to insert a VI into the subpanel, run the subpanel VI, and abort the subpanel VI when closing the main view VI.

 

Since this is what we want to do with a subpanel 99% of the time, I am recommending that LabVIEW include a "smart subpanel" that handles this use case in a straightforward fashion.  (All we want to do is select the VI I want to put in the subpanel, and LabVIEW can handle the rest.)  Why should the particular application deal with these (repeatable) details?

 

Notes:
1) There are other ways to use subpanels (although I don't use those ways), I realize, so I am in favor of keeping the current version of the subpanel as well.

2) I know we can write an XControl to do this, but that is a more complicated solution to implement, not a simpler one, and I think the smart subpanel behavior we are seeking should be part of native LabVIEW.

3) I think the smart version of the subpanel should include a property to change the visibility of the subpanel.

4 Comments
PaulLotz
Member
PaulLotz
Member

By the way, in the original post I wrote: "(Yes, I know we can size the contents of the subpanel to match the size of the subpanel, but we have yet to have a use case for this.)" That makes no sense.  I was confused about the intent of the "Fit Control To Pane" method.

PaulLotz
Member

Other notes:

We figured out a way to determine the required size of the subpanels (by constraining the problem).

There already is a subpanel property to control visibility.

A simple way to stop a VI in a nested subpanel still is needed.

PaulLotz
Member