GDS(Goop Development Suite)

cancel
Showing results for 
Search instead for 
Did you mean: 

Create Method doesn't work for a class created of a template class

Please see the screenshot of the Create Method Dialog (EndevoGOOP400) window attached. Why is Property Node Disabled? Why are no Get Property/Set Property method templates available? The whole dialog just doesn't work for my class, but works for other EndevoGOOP400 classes. My class was created from my template class, but that template class is just an EndevoGOOP400 class too and this dialog works correctly for it.

Message 1 of 5
(3,474 Views)
Please look at the attached two classes. SampleDVR Class is just that, a class created by doing New/GOOP Class and then selecting Simple DVR Template. Right clicking on it and selecting GOOP/Add Method brings a normal  Create Method Dialog (EndevoGOOP400).
 
Open_GDS Create Method not working for a class created off a template (Normal dialog).png
However, if you put this class into <LabVIEW>\resource\Framework\Providers\Open_GDS\ClassProviders\Provider_EndevoGOOP400\Templates folder and use it as a template to create a new class (I created the attached Class4 that way), and then try to do right-click/GOOP/Add Method, the Create Method Dialog (EndevoGOOP400) dialog looks very different as shown in the following screenshot. You can't add neither a Property Node nor even a Property Method because although that option is still enabled Method Template list is empty.
 
Open_GDS Create Method not working for a class created off a template.png
 
This bug severely damages the otherwise great ability to create your own class templates and make classes off them. It is, of course, still possible to add accessor (Property) methods to classes created off custom templates but it is much more laborious.
Download All
Message 2 of 5
(3,448 Views)

From Mikael's explanations:

 

If you want the Create Method Dialog to let you use some method templates while adding methods to a class created off your class template (including standard accessors, "Property Method" and "Property Node") then your class template folder (which you put into <LabVIEW 20XX>\resource\Framework\Providers\Open_GDS\ClassProviders\Provider_EndevoGOOP400\Templates) better have a "methods" folder in it similar to other template classes provided with Open GDS in the same Templates folder, for example, G4BaseTemplate_Simple_4x4x4. The VI's in that folder are not actually methods of your template class! They are templates for creating methods for classes created off the template class. Since my template class was created off the Simple DVR class template that comes with Open GDS, I just copied the "methods" folder from G4BaseTemplate_Singleton_4x4x4 folder to the folder for my template class (or class template?) and got the standard Get/Set, Read/Write method TEMPLATES available again in the Create Method Dialog for the classes created of my class template. You can add your own method templates to your class templates too! Again, method templates in a class template are not methods of the template class itself! They are just that, templates for creating new methods in classes created of that class template!

0 Kudos
Message 3 of 5
(3,432 Views)

Well, just copying "methods" folder from another class template into your class template folder won't work. The Create Method Dialog will now show correctly and allow you to choose the same method templates but it will not create correct methods off the VI's in that copied "methods" folder for your classes made off your template. You have to edit all the methods templates correspondingly to match your template class (replace "reference in", "reference out" controls and the calls to ..._GetAttributes.vi). While you are at it you might as well rename every VI in that "methods" folder to include your template class name and edit the methods.ini file there to reflect the names changes.

0 Kudos
Message 4 of 5
(3,430 Views)

Yes that is the correct way of doing it.

If there are more good class templates out there, we could add them as permanent templates in the OpenGDS, or maybe add a repository that the tool can look at, and automatically download them from.
One issue with custom templates is that you need to install them on all your development computers, so you can create new classes of that template and create methods for that class.
You might also get some issues implementation some design patterns if the class templates looks very different.

0 Kudos
Message 5 of 5
(3,419 Views)