Skip to content

User Guide

Ábel Hegedüs edited this page Sep 29, 2015 · 22 revisions

Prerequisites

If you haven't installed EMDW-MC into your Eclipse please follow the instructions from here

Opening models with Papyrus

If you did not install CDT features

Papyrus has its own perspective defined for working with UML models. In the Project explorer related files of a given "model set" (files with same name as a UML model but using different extensions) are collapsed into a virtual element (the virtual element's name will be the same as contained elements'). You can open this virtual element like a directory to access the individual files. Note that double-clicking on any of these files will open the Papyrus editor, instead use the Open action from the local menu. Since the Model Compiler generates additional files with the same name as the UML model, these will also be put under the model set (.xtuml, .trace and .cppmodel).

If you installed CDT features

In Papyrus perspective in the Project Explorer you will not see the model by default. Open Customize View... and check out Di view then you will see the original files (not the virtual element mentioned before).

Invoking the code generation

The model compiler can be executed using the local menu of the Papyrus Model Explorer view when the selection is a Model object (this is the root element). Click on the Generate CPP code for selected UML model entry to generate the C++ code.

C++ Code Generation from Model Explorer

After the generation is complete, the workspace will contain a new project named com.ericsson.emdw.cpp.generated.code.<model_name>

The followings are not generated yet:

  • any files related to elements outside of components (e.g. global classes or type definitions)

Compiling the generated code

The generated project contains a Makefile in the root directory and the code is set up with an empty main file so simply calling make in the command line is enough to compile the whole project.

For advanced users with experience in using CDT

You can import the generated project into CDT with selecting Import, Project from existing Makefile. This should set up the project with the proper CDT preferences and both compiling and running works from inside Eclipse. However, dealing with complexities like toolchains and paths may be required.

Troubleshooting

  • Currently, only classes within components are supported (you can use packages both outside and inside components for hierarchy).
  • In some cases, you may find that the xtUML model is not created or does not contain every information that you wanted to model in your UML model. This may be caused by not satisfying some of the assumed validation rules, as described on this page.
  • The UML-to-xtUML transformation starts immediately after opening the Papyrus editor and modifications are mapped as they are made. However, you have to save your UML model in order to trigger the saving of the .xtuml file as well.
  • In some cases, the C++ code generation may fail without writing anything on the disk or showing any errors. This may be caused by not satisfying some of the assumed validation rules, as described on this page
Clone this wiki locally