β08-17-2010 04:15 AM
Hi all,
suppose we have a LVOOP framework that uses Data Value References heavily. So, we create a cluster with all the class data members, and then in the "Private data for [class]" control we just store the DVR.
As you can imagine, creating getters and setters for those is rather cumbersome. So, I would like to script this, and my question is - is what I want to do even possible?
My plan:
Create a script which would enable the developer to select a class and then run the "generate getters and setters function"
The function should:
- inspect the "Private data for [class]" control for all the DVR variables,
- check what clusters they "point to",
- open those clusters and read all the members,
- list those members to the user (like LV does for normal classes now),
- when the user selects a member, generate a getter and/or setter for it out of some template:
- the templeate would use in-place structures to "open DVR" and again in-place structure to read/modify the cluster members
Doable? Yes/no/maybe?
Thanks in advancew and best regards, Miha
β08-17-2010 07:19 AM
This is certainly possible. You may find the code in <vi.lib>\Utility\VariantDataType useful for this endeavor. The current LabVOOP interface has this functionality for normal class data. You can probably leverage the templates for you functions. See Darren's Nugget for where they are. Good luck. Let us know if you need more information.
β08-17-2010 03:36 PM
Of cause itβs possible; I do that in the GOOP Development Suite.
Start by creating a Template VI.
Open a reference to the project and then the lvclass item.
Then save a copy of the template into the class and add it to the class.
Then replace the class controls and update the control/indicator and update the Bundle/Unbundle name.
Cheers,
Mikael