06-12-2012 02:49 PM
I have implemented some classes where the children can expose themselves using a configuration screen as shown below.
Since new shape may be required in the future I implemented my classes such that they have methods to;
Insert in sub-panel
Apply setting
Save
Anything that does not fall into the methods I have in parents can only be accessed through the config panel.
I'll post the NI Week paper if NI balks at it.
Ben
06-14-2012 10:59 AM
(ignore the error wires...just copied and old image.)
I might have missed it during this thread...but, how do I load the parent object (used above as the specific termainal on the To Specific above) knowing only the name of it's file on disk?
For example, I'd like it to be specified externally, not baked in the code.
06-14-2012 11:14 AM - edited 06-14-2012 11:20 AM
@MacDroid wrote:
(ignore the error wires...just copied and old image.)
I might have missed it during this thread...but, how do I load the parent object (used above as the specific termainal on the To Specific above) knowing only the name of it's file on disk?
For example, I'd like it to be specified externally, not baked in the code.
It's not possible to dynamically change the constant class wired to the To More Specific node. I think your best bet is to create one of these load class VIs for each of your parent classes.
Again though, your code isn't going to be able to predict the future and your code will have to be edited as you add more parent classes.
06-14-2012 11:41 AM
So, bottom line: you have to bake at least the parent into the code?
06-14-2012 11:45 AM
@MacDroid wrote:
So, bottom line: you have to bake at least the parent into the code?
As far as I know. There may be some more sophisticated methods or hacks I'm not aware of.
06-14-2012 12:09 PM
@MacDroid wrote:
So, bottom line: you have to bake at least the parent into the code?
Only if you want it do something useful.
The generic LV Class from which all other descend has no methods.
I have some plug-ins that only have Create, Run Close so my home baked version of the Actor Frame work just has those methods. What happens inside is determined by the falvor I selected.
Ben
06-15-2012 07:25 AM
Ok, so the parent class TOP has methods X, Y, Z.
Child A has X, Y, Z
Child B has X, Y, Z, W
A & B are loaded into an array and X, Y, Z can be accessed with To Specific with the target input wired to a TOP object.
How do I access W? Like so:
06-15-2012 07:33 AM
@MacDroid wrote:
Ok, so the parent class TOP has methods X, Y, Z.
Child A has X, Y, Z
Child B has X, Y, Z, W
A & B are loaded into an array and X, Y, Z can be accessed with To Specific with the target input wired to a TOP object.
How do I access W? Like so:
You would have to invoke W from with X, Y, or Z.
Other wise you will need a wire of type B to invoke W.
Ben
06-15-2012 07:36 AM
So in the image, I can call (blue 1) from within (yellow1)?
06-15-2012 07:47 AM
@MacDroid wrote:
So in the image, I can call (blue 1) from within (yellow1)?
I don't know what your color scheme is so I will ignore that part.
You have the parent TOP.
In your code you invoke X then Y then Z using the methods from TOP.
If you code B's version of X such that it calls X from TOP then (still inside of B's X) invokes W when the type flowing on the wire is of type B, then the over-ride VI of B will be invoked.
Ben