A. 配置Eclipse环境
- 安装JRE,测试版本jdk-8u191-windows-x64,这里JDK/JRE一起装的。
- 安装Eclipse,版本必须是eclipse-modeling-luna-SR2-win32-x86_64(位数无关)。
- 进入Eclipse,“help”→“Install New Software”→“Add”→“Archive”,选择opendds_modeling_site.zip进行安装。
- 配置“Perspective”,选择“OpenDDS Modeling”。
B. 使用Modeling SDK
- 新建一个General project,添加“OpenDDS Diagram”和“OpenDDS SDK Code Generator”(Target Folder随意写一个就可以,就是当前目录下,没有会自动创建)。
- DDS全部配置好后,在“default.codegen”中点击“Generate All”,生成所有必须文件,文件介绍如下表所示:
File Name | Description |
---|---|
<ModelName>.idl | Data types from the model’s DataLib |
<ModelName>_T.h | C++ class from the model’s DcpsLib |
<ModelName>_T.cpp | C++ implementation of the model’s DcpsLib |
<ModelName>.mpc | MPC project file for the generated C++ library |
<ModelName>.mpb | MPC base project for use by the application |
<ModelName>_paths.mpb | MPC base project with paths, see section 11.3.3.7 |
<ModelName>Traits.h | Transport configuration from the .codegen file |
<ModelName>Traits.cpp | Transport configuration from the .codegen file |
- 使用mpc导出目标平台工程配置文件
mwc.pl -type vc12/gnuace
C. 使用SDK生成的动态库
- 参考《OpenDDS-latest.pdf》的11.3.3节,OpenDDS-3.13/tools/modeling目录下,REDME有安装和使用文档,tests目录下有测试用例。