05-13-2015 09:53 AM
I have a cluster of various controls, I am passing the control references and trying to use to more generic class -> property label.text. However when I wire a cluster generic constant it returns a broken wire. Is there an easy way of doing this, getting the cluster label based on one of it's control's references?
05-13-2015 09:56 AM
that's what I am essentially trying to do
05-13-2015 05:50 PM
05-13-2015 06:00 PM
Can you explain your larger goal? There might be an alternate approach that doesn't involve a reference.
05-14-2015 12:54 AM
This is not what To More Generic Class does at all. Read its help and the error description and you might understand why it's broken and why it won't help you even if it wasn't.
As Mike suggested, the Owner property should return the reference of the immediate container.
Also, I would also say that if you're using something you're not understanding, it's quite possible that there are much better ways to do what you actually want to do, so you might want to explain that before moving forward.
05-14-2015 06:18 AM
gee, I feel scolded like a high-school kid, so many assumptions...
I am passing a reference to the control to the slave loop, where I want to get the owner's (cluster) label in order to see which category the control belongs, when storing to ini file. Cluster being the parent of the control should work in theory, in fact I may have gotten it to work in lv2013 (now using 2014).
I have tried the owner property, owner property didn't work for me, if someone can show how to accomplish that graphically I would hightly appreciate it.
05-14-2015 06:47 AM
You probably should feel somewhat scolded, but I'm not sure which assumptions you're talking about. I would still stand by the content of my previous reply, even if the presentation could be made more PC.
You still haven't said why it doesn't work, but I'm guessing it's because you haven't done the casting I did in the following image? Note that this is a cast down, not up, which is why it doesn't break the wire.
As for alternatives, there are already tools for saving clusters to files (the OpenG variant config VIs and MGI R/W anything VIs, to name a couple of examples). You might be better off using those.
05-14-2015 06:51 AM
Thanks...I tried different combinations with the owner property, and it's clearly a cast down, since you casting down from the owner class to the cluster class. In my case I was trying to cast up from control to it's cluster, which didn't work. I appreciate your help.
05-14-2015 07:15 AM
05-14-2015 07:53 AM
Just so it's clear - there is no Owner class. The owner has nothing at all to do with the class hierarchy, but rather of the positioning of elements on the FP/BD. The owner is a property of one of the classes (GObject, I think, but I can't check), which simply returns a reference to the object that contains that object (for instance, if you have a control inside a cluster).
The class of that reference is Generic, as can be seen in the header of the property node. I could have also cast it down to the Control class, which is where the Label property actually is, but that's only because I happen to know that the owner in this case is a Control (and a Cluster).