code generation, save, and load
#contents
Code Generation
After setting various profile information for the RT component to be generated, generate the template code.
When you click the [Generate Code] button on the Basic Profile input page, template code corresponding to the entered profile information is generated.
The template files generated when code generation is executed after selecting each language are as follows.
- C++ (when the “Use old build environment.” checkbox is not selected)
| File Name | Description |
| <RTC name> Comp.cpp | Code for starting the RT component. |
| <RTC name>.h | Header of the RT component body. |
| <RTC name>.cpp | Code of the RT component body. |
| <service type name>SVC_impl.h | Header of the service provider. (*) Only the Type specified in ServiceProvider is output. |
| <service type name>SVC_impl. cpp | Implementation code of the service provider. (*) Only the Type specified in ServiceProvider is output. |
| CMakeLists.txt | Configuration file for CMake. |
| doc/ | |
| doxyfile.in | Configuration file for Doxygen. |
| cmake/ | |
| uninstall_target.cmake.in | Template file for adding an uninstall target (for CMake) |
| cpack_options.cmake | Module for creating WiX packages (for CMake/WiX) |
| License.rtf | License display included in package information (for CMake/WiX) |
| wix.xsl.in | Template for specifying files to include in the WiX package (for CMake/WiX) |
| cmake/Modules/ | |
| FindOpenRTM.cmake | Module for obtaining OpenRTM-aist environment settings (for CMake) |
- C++ (when the [Use old build environment.] checkbox is selected)
| File Name | Description |
| <RTC name> Comp.cpp | Code for starting the RT component. |
| <RTC name>.h | Header of the RT component body. |
| <RTC name>.cpp | Code of the RT component body. |
| <service type name>SVC_impl.h | Header of the service provider. (*) Only the Type specified in ServiceProvider is output. |
| <service type name>SVC_impl. cpp | Implementation code of the service provider. (*) Only the Type specified in ServiceProvider is output. |
| Makefile.<RTC name> | Makefile for compiling. |
| <RTC name> _vc8.sln | Solution file for Visual Studio 2005. |
| <RTC name>_vc8.vcproj | RT component project file for Visual Studio 2005. |
| <RTC name>Comp_vc8.vcproj | Project file for startup code for Visual Studio 2005. |
| <RTC name>_vc9.sln | Solution file for Visual Studio 2008. |
| <RTC name>_vc9.vcproj | RT component project file for Visual Studio 2008. |
| <RTC name>Comp_vc9.vcproj | Project file for startup code for Visual Studio 2008. |
| Copyprops.bat | Batch file for copying property files. |
| User_config.vsprops | User-defined property file. |
| OpenRTM-aist.vsprops | Property file for OpenRTM-aist. |
- Java
| File Name | Description |
| <RTC name>Comp.java | Class for starting the RT component. |
| <RTC name>.java | Class that defines the RT component's Component Profile, initialization processing, and so on. |
| <RTC name>Impl.java | Main body of the RT component. |
| build_<RTC name>.xml | Build file for the RT component. |
| <service type name> SVC_impl.java | Implementation class of the service provider. (*) |
| CMakeLists.txt | Configuration file for CMake. |
| doc/ | |
| doxyfile.in | Configuration file for Doxygen. |
| cmake_modules/ | |
| cmake_javacompile.cmake.in | Template file for adding a Java compile target (for CMake) |
| FindOpenRTMJava.cmake | Module for obtaining OpenRTM-aist-Java environment settings (for CMake) |
| cmake/ | |
| uninstall_target.cmake.in | Template file for adding an uninstall target (for CMake) |
| cpack_options.cmake | Module for creating WiX packages (for CMake/WiX) |
| License.rtf | License display included in package information (for CMake/WiX) |
| cpack_resources/ | |
| wix.xsl.in | Template for specifying files to include in the WiX package (for CMake/WiX) |
- Python
| File Name | Description |
| <RTC name>.py | Code of the RT component. |
| <service type name>_idl.py | |
| <service type name>_idl_example.py | Implementation file of the service provider. (*) |
| CMakeLists.txt | Configuration file for CMake. |
| doc/ | |
| doxyfile.in | Configuration file for Doxygen. |
| cmake_modules/ | |
| FindOpenRTMPython.cmake | Module for obtaining OpenRTM-aist-Python environment settings (for CMake) |
| cmake/ | |
| uninstall_target.cmake.in | Template file for adding an uninstall target (for CMake) |
| cpack_options.cmake | Module for creating WiX packages (for CMake/WiX) |
| License.rtf | License display included in package information (for CMake/WiX) |
| cpack_resources/ | |
| Description.txt | Description included in package information (for CMake) |
| License.txt | License display included in package information (for CMake/Linux) |
| wix.xsl.in | Template for specifying files to include in the WiX package (for CMake/WiX) |
- When outputting the service provider implementation file, RtcBuilder parses the IDL in order to generate operation templates. However, this parsing function has the following limitations.
- In the preprocessor, only the #include directive can be used. (#ifdef and similar directives are simply ignored.)
- The generated operations are only the operations of the directly specified interface, and do not include operations inherited from parent interfaces.
Output Selection
If a file with the same name as a generated file already exists in the output destination, and there is a difference in output content between the existing file and the generated file, RtcBuilder displays a confirmation screen for selecting which output to use.
In output selection, select from the following three output candidates.
- Original: Leave the existing file as-is
- Merge: Perform merging using merge blocks (Note 1)
- Generate: Overwrite with the newly generated content
Note 1 In Merge, only the range enclosed by the <rtc-template block=”block”> tag is overwritten with the latest generated content. In the generated template, the range that users should not modify is enclosed with this tag in advance.
Anything inside this tag will disappear after modification when merged, so do not modify it.
Perspective Switching
If a development environment plugin for the target generation language is installed, a confirmation message for switching perspectives is displayed after code generation is executed.
If the target plugin is installed, a message like the following is displayed, so select whether or not to switch perspectives.
The relationship between the generation language and the development environment plugin is as follows.
- Java: JDT (Java Development Tools) → A development environment included in Eclipse in advance.
- C++: CDT (C/C++ Development Tooling)
- Python: PyDev
Note: If a development environment plugin for each language is installed and the output target project is a newly created project, the attributes of the target language are set in the properties of each project.
Packaging Function for Generated Files
This function archives generated template files, executable binary files of RT components created based on template files, and other artifacts in various formats.
When you click the [Package] button on the Basic Profile input page, the “RT Component Packaging” screen for setting packaging details is displayed.
Each item is explained below.
| Item | Description |
| Target Project | Select the project to be packaged. |
| Destination Directory | Enter the directory to output the packaged artifacts. By using the "Browse" button, a directory selection dialog is displayed. |
| Archive Method | Select the format of the archive to be created. |
| Options | Overview description of the behavior within each action. This item can be omitted. |
| Archive Format | It is possible to create archives using the ZIP format and archives using the tar format. Select the format to use. |
| Compress Archive Contents | If you want to compress the archive contents, turn on the checkbox. |
| Directory Structure | Select whether to archive while preserving the directory structure of the target project as-is, or to archive with everything placed in the root directory. |
Note: For each archive method (“source”, “binary”, “source + binary”), which file types are included in the archive can be configured on the “Settings Screen” described later.
Saving and Loading Settings
RTCBuilder can save the content entered in the RTC Profile Editor to an RTC profile XML (RTC.xml), and can load the saved content again.
Save
The content entered in the RTC Profile Editor can be saved to an RTC profile XML (RTC.xml). The entered content can be saved by the following operations.
- Right-click the editor and select [Save] or [Save As…] from the displayed context menu
- Select [File] > [Save…] or [File] > [Save As…] from the menu bar
Note: If [Save As…] is selected, it can be saved in any project.
| Save | |
|---|---|
Load
The RTC profile XML (RTC.xml) that stores the content of the RTC Profile Editor can be loaded by the following operations.
- Right-click the editor and select [Open] from the context menu
- Select [File] > [Open File…] from the menu bar
| Load | |
|---|---|








