LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change properties of a cluster element withing an array of clusters

Solved!
Go to solution

Hello all,

 

I have an array of cluster that is shaped as a line with different display elements.

 

A list or a tree wouldn't have made it, so I had to use a cluster and make a table.

 

The problem is that I want to change not only the text but also the text color.

 

Individually.

 

I found this :

 

http://www.ni.com/example/30904/en/

 

But it change the property in all the clusters in the array, not just the one I need.

 

Some people have the same problem :

 

http://forums.ni.com/t5/LabVIEW/Reference-to-Array-of-Clusters-with-an-array-element/td-p/1006427

http://forums.ni.com/t5/LabVIEW/Different-set-of-values-for-two-rings-in-an-array-of-clusters/m-p/10...

http://forums.ni.com/t5/LabVIEW/array-of-clusters-get-references-to-all-the-clusters/td-p/1079456

http://forums.ni.com/t5/LabVIEW/How-can-I-reference-the-properties-of-a-control-in-a-cluster-in/m-p/...

http://forums.ni.com/t5/LabVIEW/Writing-only-to-certain-cluster-elements-in-an-array-by/m-p/2200728

http://forums.ni.com/t5/LabVIEW/Update-Properties-Of-One-Control-In-An-Array/m-p/3015501

http://forums.ni.com/t5/LabVIEW/Array-of-clusters-and-in-the-cluster-is-a-bar-meter-how-can-I/m-p/15...

http://forums.ni.com/t5/LabVIEW/Property-node-of-a-control-inside-of-cluster-inside-an-array/m-p/946...

 

Obviously, while in a list/table or tree you can change the property of an individual

cell (font, color) you cannot do it within an array of cluster, by some sort of magic,

the property of a cluster element (font, color) are all linked together, hence rendering

the use of an array worthless.

 

A possible hack is proprosed by using control masking, setting one visible and the

other invisble, swapping their position, whatever. It's a hack you have to perform,

hence add another code to maintain.

 

Is that still the case or is there now a more official way to handle individual cluster

properties, not just its data ? After all that's a common real-life example that should

be handled by Labview. In my opinion.

 

David Koch

0 Kudos
Message 1 of 35
(7,059 Views)

Every element in an array has the exact same properties.  It doesn't matter if the data is a cluster.  The reason is the way the array is rendered.  It is the same control/indicator duplicated with a different value.

 

What is all of the data in your cluster?  You may be able to get away with a Table, which will allow you to do what you want on a cell basis.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 35
(7,018 Views)

Hello, thanks for the feedback.

 

Basically, each line mirror a database table. The important point :

 

TFS_cluster_fcuk.png

 

In red, enums automatically set and displaying the right value

In blue, the test result I want to change the font color, line per line

 

I don't see why the property of a string cannot be set on an individual

basis. OK to say that at this location there is a string indicator, now

I'd like to change the color. Currently it's set to black, either is pass

or fail. I just wanted to use normative colours such as green vs. red.

 

David Koch

0 Kudos
Message 3 of 35
(7,005 Views)

I'd say the easiest solution is to add a color box behind the text and color the "background" that way. It's not quite what you asked for, but a workaround.

A very cumbersome solution is to remove the array and place free controls and access them through some smart function. You'd also need to implement a free scrollbar which'd fill the controls through some offset and such ...

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 35
(6,990 Views)

Something along this line:

ColoredTextInArray.png

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 35
(6,984 Views)

 

I'll never ever get out of this, thanks anyway for the kind offer, but no.

 

I would have accepted this in Labview 2 or 3. Not in 2013 or 2014.

 

David Koch

0 Kudos
Message 6 of 35
(6,978 Views)

What about an XControl? The datatype could be a cluster with the string and text color info and the display could be just a string.

 

OK, just looked into that a bit and it looks like that won't work.

http://digital.ni.com/public.nsf/allkb/E6C1D232D864624D8625713800495D83

 

Here's the request to make something like that work

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Array-of-XControls/idi-p/1107173

0 Kudos
Message 7 of 35
(6,949 Views)

One of the elements could be a 2D picture indicator of about the same size. You can write text in any color using picture functions.

0 Kudos
Message 8 of 35
(6,935 Views)

in THEORY (have never tried it)  you could use an active X Object created from (and Linked to) an excel spreadsheet letting Excell handle some of the formating since those tables can have enumerated pulldowns or even pictures.

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 35
(6,914 Views)
Solution
Accepted by topic author Kochise

@altenbach wrote:

One of the elements could be a 2D picture indicator of about the same size. You can write text in any color using picture functions.


Here's what I had in mind. Seems to work just fine (I would fine-tune the font, picture border, etc. but this should get you started).

 

Download All
Message 10 of 35
(6,909 Views)