LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array of cluster

Solved!
Go to solution

Hello,

 

i'm using array of cluster to allow user entering differents setting

 

But in some case i would like to adapt viewing to hide  some parameters or displaying 0 or a null field

my problem is when creating a ref on control in the list how to know wich line is concerned to modify the good one

 

 

here a vi for example

 

when case 1 is seleced in first column other ctl can be any of  choices

 

when case 2 is selected i would like the mofify two others to be 0 and none

 

 

is there an other way than playing with coordonate and size of elements to know which line is the current one ?

 

Regards

 

Tinnitus

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 1 of 11
(15,748 Views)

This is one of those times when an X-control can be pretty handy.  in this case, If your cluster was an X-control the control itself would respond to the data change on the ring and cause the desired changes to the rest of the cluster elements.  There is an shipping example for X-controls and the help covers the basics fairly well.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 11
(15,732 Views)

Hello,

 

Unfortunately  i don't have X-control fonctionality

 

Regards

 

Tinnitus

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 3 of 11
(15,728 Views)

You can't get a reference to an individual element of an array - all array elements are the same.  They can have different values but not different properties, so for example you cannot disable a control on one row and leave it enabled in another row.  Likewise if you want to modify the items in a ring, every row in the array will be affected.  If you're willing to put in more time to get a good-looking interface, you can do it with a table indicator and some individual controls.  As the user navigates through the table, move the appropriate control over that cell in the table and make it visible.  When the user moves off that cell, update the value in the table and hide the control.  This gives you full control over what options the user has at each location, at the cost of some extra programming.  Here's an example from an application I wrote (sorry, I can't pull the user interface code out of the proprietary parts easily).  The first column (Product) is a ring that is populated as necessary.  The second column uses a numeric control and the third is an enum (the only possible values are "This Week" and "Next Week".  The remaining columns are display only, calculated from the values in the first three columns.

Message 4 of 11
(15,723 Views)

Hello Nathand,

 

thank you for details.

 

what do you mean with table indicator , a multicolumn list ?

 

Could you post 2,3 pictures of FP to illustrate how it appears to user ?

 

 

Regards

 

Tinnitus

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 5 of 11
(15,693 Views)

The picture I posted does show how it appears to the user.  The user can click on any of the cells in the first three columns (and can use tab to move between them).  When the user navigates to a cell, a control of the appropriate type (enum, numeric, ring) appears at that location, as shown with the Week enum in row 3, so the user can make a selection.  When the user navigates away from that cell, the value is copied to an array of strings, and the control is hidden.  By a table indicator I mean exactly that - there is a front panel object called a "table" and you can make it an indicator.  It displays an array of strings.

 

Which version of LabVIEW are you using (Base, Professional, etc)?  This code relies heavily on the event structure, and if you do not have XControls, I wonder if you also do not have the event structure.

0 Kudos
Message 6 of 11
(15,668 Views)

Hello,

 

I have full version + builder ( a mistake i know )  , yes event is available ,  ok with table

 

what picture are you talking about  ?

 

 

 

 

 

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 7 of 11
(15,662 Views)

I linked to an image hosted on lavag.org (I'd posted it there in a somewhat related discussion a while ago) - does it not show up for you?  Here it is again, attached directly.

table indicator with controls.png

Message 8 of 11
(15,653 Views)
Solution
Accepted by tinnitus

I was able to simplify that VI to the point where I can post the code to demonstrate the idea.  Here it is in both 8.6 and 9 (it seems to have lost some font formatting when saving back to 8.6).  I haven't used XControls at all but it seems like the sort of thing that could be converted to one easily if I had the time and need for it.

Array of Clusters in Table image.PNG

Download All
Message 9 of 11
(15,645 Views)
Message 10 of 11
(15,576 Views)