06-09-2008 10:46 AM
06-09-2008 12:28 PM
06-09-2008 12:51 PM
I don't think that avoids the massive number of set methods though. I do want to change this over to an event driven application, so there might not be a way around this. I was hoping to update all Class parameters when the main part of the program executes with set-all methods that use the logical(virtual) clusters.
I don't think National has given this any thought yet because without OOP it wouldn't have been obvious (at least to me) that it was needed. Though I could see the usefulness of providing a way to disassociate front panel grouping from program grouping of controls, even if not using classes to define new data types for use in the code. But Labview has so many features that I don't know about, that I am hopeful that somene knows of a way to do this. .
David
06-09-2008 01:59 PM
If I understand correctly, you want to link controls with the class data. This is a bit anti-OOP (OOP is also about information hiding, so you're no supposed to know what's going on inside the class), but here's a possibility - You can add a VI to the class which will register the relevant controls (example) and handle what you want using dynamic event registration. This will allow you to have separate controls and connect them.
06-09-2008 02:49 PM
Thanks, but I don't intend to violate the rules of OOP. I would still have an accessor method (VI) called configAllParams that would take the virtual cluster as an input. I have to give some thought into how I could preserve the Public Interface with something like this.
I'm not sure I understand what you are suggesting, but I'll look at that in a few days. It sounds like passing a reference to the calling VI into a sub-VI to access control values. I don't understand how this works in enough detail so that I know I won't be breaking code if I update control names in the calling VI.
Thanks, David
06-09-2008 03:09 PM
I'm not talking about passing the reference of the VI, but the references of the controls. This will protect against name changes, etc.
David at Lockheed wrote:
It sounds like passing a reference to the calling VI into a sub-VI to access control values.