NISystemsEngineering / FrontPanelLayout

The Front Panel Layout Tool provides the ability to use a single VI’s front panel with various different window sizes and layout configurations.
https://decibel.ni.com/content/docs/DOC-26783
BSD 2-Clause "Simplified" License
8 stars 4 forks source link

Resizing of Arrays causes several problems #6

Open jgr1969 opened 8 years ago

jgr1969 commented 8 years ago

The resizing of arrays causes some funny issues and errors. Cause of these problems is that the Refnum of the array element will point to the last element in the array that the user clicked or changed.

Try the following things with the VI (LabVIEW 2015) included in the zip-File attached.

Array Issue.zip

Start the VI and e.g. maximize the window size -> OK Set back to original size -> OK Change the value 10 in the leftmost array (ArrayElement Refnum will now point to that specific numeric) Maximize VI window size -> Top position of "Array" is not aligned anymore with the other element -> FAIL Set back to original size, click element 1 of "Array".

This error is even worse if the array element is a cluster that is not set to "autosizing". This is demonstrated with "Array 2", just click on the last element of that array and than resize the frontpanel -> major fail, because the position of the "wrong" cluster elements (in comparision to the elements of the xml-file) gets changed and suddenly all cluster elements are "invisible".

Clicking on the first visible element of "Array 2" at least recovers the position of the cluster elements after the next resizing.

Work-arounds: Activating "AutoSize" on the cluster at least resolves the issue that the cluster elements are "invisible". But after that, the array itself can get repositioned. That problem can be resolved by changing the code of the VI "NI_SE_Front Panel Layout.lvlib:Array Control Layout.lvclass:ApplyLayoutToObject.vi". - see attached image:

image01

jgr1969 commented 8 years ago

Today I found another solution to solve this issue: The visible size of the array has to be decreased to only 1 element in total. The Refnum "ArrayElement" will than point to exactly this 1 element. All position and resize changes are then applied to this one element. After resizing the element, the visible size of the array gets changed back to its original values:

image02