Overwriting generated code.

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
yvesP
Sr. Member
Sr. Member
Posts: 15
Joined: 13 Feb 2017, 14:15

Overwriting generated code.

Post by yvesP »

Hi,
We need to extend a previously defined object ObjectA which has a number of methods for which we have implemented the generated empty body. When adding new methods and generating the code for this it will also overwrite the existing ones. What are possible strategies to integrate this into a development process? I can imagine generating the new code on a temp location and doing a manual merge using some supporting tool like Kdiff3. Are there other, better, approaches in use?
Regards.
Yves

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: Overwriting generated code.

Post by Support Team »

UaModeler has four modes for overwriting files. Please see documentation.
"Overwrite all" is the default setting. In this mode all files are overwritten but the files that are expected to add own code. Especially the method implmentation files are not overwritten, so the own code does not get lost.
But if you are adding new methods the new method stubs will not be generated. In this case you have to create the methods by your own. The best practice depends on the selected SDK and own preferences. You might copy the stubs from generated header files, use diff tools kdiff or use ide features to add methods that are defined by an interface.
Best regards
Unified Automation Support Team

Post Reply